...">

Conflict strings.xml in Android manifest

I have this in Android Manifest:

<application
    android:label="@string/app_name"
    ...
</application>

and strings.xml:

 <string name="app_name">My App Name</string>

Everything is fine. Now my problem is that I am using a dependency aarwhose file strings.xmlcontains an element with a name app_name.

 <string name="app_name">My Library Name</string>

And my project uses the second option.

How can I resolve this conflict?

+4
source share
2 answers

The unique resource name for the item that you can use to get a view link from your application.

For a better way, just use a Different string name .

+4
source
**Its very easy change key value app_name as per your way**

example

change strings.xml
<string name="app_name">My App Name</string> line like
<string name="my_app_name">My App Name</string>

Then in manifest file use
<application
    android:label="@string/my_app_name"
    ...
</application>
+1
source

Source: https://habr.com/ru/post/1622702/


All Articles