Skip to content

Does not work well with library flavors resources #1

Description

@ihitang

Hi mate,

I've created dev, prod folders, added new string resources with lib_name="prod" and "dev" accordingly.
Changed activity's layout to how me lib_name.

And get en error:
Error:(8, 29) No resource found that matches the given name (at 'text' with value '@string/lib_name').

Here's a git patch:

Index: app/src/main/res/layout/activity_main.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/src/main/res/layout/activity_main.xml   (revision 802844b15ffee6179ad687827661993a05a53b33)
+++ app/src/main/res/layout/activity_main.xml   (revision )
@@ -5,7 +5,7 @@
     android:paddingTop="@dimen/activity_vertical_margin"
     android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

-    <TextView android:text="@string/hello_world" android:layout_width="wrap_content"
+    <TextView android:text="@string/lib_name" android:layout_width="wrap_content"
         android:layout_height="wrap_content" />

 </RelativeLayout>
Index: mylib/src/main/res/values/strings.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- mylib/src/main/res/values/strings.xml   (revision 802844b15ffee6179ad687827661993a05a53b33)
+++ mylib/src/main/res/values/strings.xml   (revision )
@@ -1,3 +1,4 @@
 <resources>
     <string name="app_name">My Lib</string>
+    <string name="lib_name">default Lib</string>
 </resources>
Index: mylib/src/prod/res/values/strings.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- mylib/src/prod/res/values/strings.xml   (revision )
+++ mylib/src/prod/res/values/strings.xml   (revision )
@@ -0,0 +1,4 @@
+<resources>
+    <string name="app_name">My Lib</string>
+    <string name="lib_name">prod Lib</string>
+</resources>
Index: mylib/src/dev/res/values/strings.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- mylib/src/dev/res/values/strings.xml    (revision )
+++ mylib/src/dev/res/values/strings.xml    (revision )
@@ -0,0 +1,4 @@
+<resources>
+    <string name="app_name">My Lib</string>
+    <string name="lib_name">dev Lib</string>
+</resources>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions