Android的摇篮变化范围部署 [英] Android Gradle Build Variant Deploy

查看:155
本文介绍了Android的摇篮变化范围部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚完成建立构建与摇篮Android Studio中的变体。什么祝福这将是一个典型的演示/ Pro安装。我能够启动我的'demoDebug应用完全没有问题。当我切换到proDebug和运行具有相同配置它安装亲应用罚款,但崩溃启动它:

I just finished setting up build variants with Gradle in Android Studio. What a blessing this will be for a typical demo/pro setup. I'm able to launch my 'demoDebug' app perfectly fine. When I switch to 'proDebug' and 'Run" with the same configuration it installs the pro app fine but crashes launching it:

开始:意向{行动= android.intent.action.MAIN
  猫= [android.intent.category.LAUNCHER]
  CMP = com.anthonymandra.rawdroidpro / com.anthonymandra.rawdroid.RawDroid
  } 错误类型3错误:Activity类
  {com.anthonymandra.rawdroidpro / com.anthonymandra.rawdroid.RawDroid}
  不存在。

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.anthonymandra.rawdroidpro/com.anthonymandra.rawdroid.RawDroid } Error type 3 Error: Activity class {com.anthonymandra.rawdroidpro/com.anthonymandra.rawdroid.RawDroid} does not exist.

如果我然后去我的仪表板可以启动Pro版本,它按预期工作。所以,安装相应版本的作品;只是有一些错误启动(上亲)。

If I then go to the dashboard I can launch the pro version and it works as expected. So the install works for the appropriate version; there's only something wrong in the launch (on pro).

的build.gradle口味:

build.gradle flavors:

productFlavors {
    demo {
        packageName "com.anthonymandra.rawdroid"
    }

    pro {
        packageName "com.anthonymandra.rawdroidpro"
    }

    proAmazon {
        packageName "com.anthonymandra.rawdroidpro"
    }
}


更新

清理多余的信息无关的问题

当我反编译我证实的的的覆盖的gradle正在在Android.manifest实施的APK。

When I decompiled the apk I confirmed that none of the gradle overrides were being implemented in the Android.manifest.

推荐答案

的问题是:

manifestmerger.enabled =假。

'manifestmerger.enabled=false'.

我禁用功能而回,因为它造成了库的问题。在此期间,我忘了,但显然库合并也适用于合并的gradle。我想这有一定的道理,但他们确实需要允许合并的gradle和图书馆合并之间的距离。

I disabled the function a while back because it caused issues with a library. In the meantime I forgot about it, but apparently the library merging also applies to the gradle merging. I suppose that makes some sense but they really need to allow for separation between gradle merging and library merging.

直到我来到了感谢@ pyus13没完没了地支持典型的哦---小号,你在开玩笑吗?

Thanks to @pyus13 for nonstop support till I came to the typical "Oh s---, are you kidding me..."

这篇关于Android的摇篮变化范围部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆