错误处理/合并清单 [英] Error processing / merging manifest

查看:26
本文介绍了错误处理/合并清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误

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

推荐答案

Apparentlt merge 依赖于main"文件夹也包含strings.xml,即使每种风格都有自己的

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

这篇关于错误处理/合并清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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