Error processing / merging manifest

2019-03-06 10:04发布

I get this error

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.

error: failed processing manifest.

...

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/"]
    }

I have defined MyAppName in file

"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>

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

1条回答
Summer. ? 凉城
2楼-- · 2019-03-06 10:11

Apparentlt merge depends on "main" folder also containing strings.xml even though each flavor has their own

查看更多
登录 后发表回答