错误处理/合并清单 [英] Error processing / merging manifest
问题描述
我收到此错误
W:\ android-studio-projects \ sharedid \ app \ build \ intermediates \ merged_manifests \ flavor_customer1Debug \ processFlavor_customer1DebugManifest \ merged \ AndroidManifest.xml:49: 错误:资源字符串/MyAppName(又名 com.customer1.app:string/MyAppName).
W:\android-studio-projects\sharedid\app\build\intermediates\merged_manifests\flavor_customer1Debug\processFlavor_customer1DebugManifest\merged\AndroidManifest.xml:49: error: resource string/MyAppName (aka com.customer1.app:string/MyAppName) not found.
错误:处理清单失败.
...
我的gradle包含了这个
My gradle contains this
flavor_customer1 {
java.srcDirs = ["W:/android-studio-projects/sharedid/app/src/main/java/"]
manifest.srcFile "W:/android-studio-projects/sharedid/app/src/customer1/AndroidManifest.xml"
assets.srcDirs = ["W:/android-studio-projects/sharedid/app/src/customer1/assets/"]
resources.srcDirs = ["W:/android-studio-projects/sharedid/app/src/main/res/", "W:/android-studio-projects/sharedid/app/src/customer1/res/"]
}
我在文件中定义了 MyAppName
"W:/android-studio-projects/sharedid/app/src/customer1/res/values/strings_specific.xml"
"W:/android-studio-projects/sharedid/app/src/customer1/res/values/strings_specific.xml"
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="MyAppName">Customer 1</string>
</resources>
在"W:/android-studio-projects/sharedid/app/src/customer1/AndroidManifest.xml"中我使用这样的字符串
In "W:/android-studio-projects/sharedid/app/src/customer1/AndroidManifest.xml" I use the string like this
<application
android:allowBackup="true"
android:icon="@drawable/app_logo__forlarge"
android:label="@string/MyAppName"
android:theme="@style/AppBaseTheme_Customer_One"
android:name="com.shared.app.MyApp"
>
...
我想念什么?我正尝试切换到使用产品口味
What am I missing? I am trying to switch over to using product flavors
推荐答案
表观合并依赖于"main"文件夹,该文件夹也包含strings.xml,即使每种风味都有自己的
Apparentlt merge depends on "main" folder also containing strings.xml even though each flavor has their own
这篇关于错误处理/合并清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!