我开发具有两种口味如下应用:摇篮建立失败不同productFlavors
productFlavors {
free {
applicationId "com.udacity.gradle.builditbigger.free"
versionName "1.0-free"
}
paid {
applicationId "com.udacity.gradle.builditbigger.paid"
versionName "1.0-paid"
}
}
现在我有一个免费版本的AdMob的依赖,并希望使付费版本完全无广告,因此决定在编译仅用于免费版本的依赖。我试着这样做如下:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(":showmessage")
testCompile 'junit:junit:4.12'
compile project(path: ':backend', configuration: 'android-endpoints')
compile 'com.android.support:appcompat-v7:23.1.0'
freeCompile 'com.google.android.gms:play-services-ads:8.4.0'}
,当我尝试打电话给gradle这个任务installPaidDebug
它给了我下面的错误:
/home/hemal/Desktop/Udacity-android-nd/Build It Bigger/app/build/intermediates/manifests/full/paid/debug/AndroidManifest.xml Error:(33, 28) No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). Error:Execution failed for task ':app:processPaidDebugResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt
但是当我简单的添加下面一行: compile 'com.google.android.gms:play-services-ads:8.4.0'
该项目是无缝构建的。
我该如何克服这一点?
在您的清单中,您包含对来自“play-services-ads”包的价值的参考。所以你必须包含它或编辑你的Android清单。 –
@ShadyAtef你能否详细说明一下?也许是一个例子? –
@Khanal好的。将留意那里的回应。 –