简体   繁体   中英

Android Manifest merger error in Codename One

In a bare bones project, I added these build hints:

android.gradleDep=compile 'com.erikagtierrez.multiple_media_picker:multiple-media-picker:1.0.5'
android.min_sdk_version=23

I would like to import the following Android library to make a CN1Lib (that requires at least Android SDK 23): https://github.com/erikagtierrez/multiple-media-picker

To be short: I spent one day trying to import that, I also experimented with Android Studio and with suggestions found on Stack Overflow (trying to make a custom .aar), without success.

Could you help me to import that library? There is manifest merger error. In fact, the issue reported by the build server is:

* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed : Attribute application@label value=(BareBones) from AndroidManifest.xml:15:17-42
    is also present at [com.erikagtierrez.multiple_media_picker:multiple-media-picker:1.0.5] AndroidManifest.xml:23:9-41 value=(@string/app_name).
    Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:15:3-43:103 to override.

I also tried to add the build hint:

android.xapplication_attr=tools:replace="android:label"

as suggested by the previous error, without success.

In the last case, I get:

Merging result: ERROR
/tmp/build1659178556337293135xxx/Test/src/main/AndroidManifest.xml:15:3-43:103 Error:
    tools:replace specified at line:15 for attribute android:label, but no new value specified
/tmp/build1659178556337293135xxx/Test/src/main/AndroidManifest.xml Error:
    Validation failed, exiting
-- Merging decision tree log ---

The last full log is here:https://gist.github.com/jsfan3/dd6c23f86a2ac949f996910c8cece62b

Thank you

This is happening because our code things you injected android:label on your own and doesn't inject it to avoid collision...

Change the code to this:

android.xapplication_attr=tools:replace="android:label" android:label="App Name"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM