React-native: Error Generating APK release AAPT: error: resource string/app_name

Created on 24 Apr 2019  路  10Comments  路  Source: facebook/react-native

Coding Questions

I get stuck when trying to generate APK.
I still got this error and I dont know why

> Task :app:processReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> Android resource linking failed
  /home/maelfosso/Documents/Projects/Apps/Guitou/Customers/jnadia40/ASQQuestionnaire/android/app/build/intermediates/merged_manifests/release/AndroidManifest.xml:15: AAPT: error: resource mipmap/ic_launcher (aka com.asqquestionnaire:mipmap/ic_launcher) not found.

  /home/maelfosso/Documents/Projects/Apps/Guitou/Customers/jnadia40/ASQQuestionnaire/android/app/build/intermediates/merged_manifests/release/AndroidManifest.xml:15: AAPT: error: resource string/app_name (aka com.asqquestionnaire:string/app_name) not found.

  /home/maelfosso/Documents/Projects/Apps/Guitou/Customers/jnadia40/ASQQuestionnaire/android/app/build/intermediates/merged_manifests/release/AndroidManifest.xml:15: AAPT: error: resource mipmap/ic_launcher_round (aka com.asqquestionnaire:mipmap/ic_launcher_round) not found.

  /home/maelfosso/Documents/Projects/Apps/Guitou/Customers/jnadia40/ASQQuestionnaire/android/app/build/intermediates/merged_manifests/release/AndroidManifest.xml:15: AAPT: error: resource style/AppTheme (aka com.asqquestionnaire:style/AppTheme) not found.

  /home/maelfosso/Documents/Projects/Apps/Guitou/Customers/jnadia40/ASQQuestionnaire/android/app/build/intermediates/merged_manifests/release/AndroidManifest.xml:23: AAPT: error: resource string/app_name (aka com.asqquestionnaire:string/app_name) not found.

  error: failed processing manifest.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2m 33s

https://stackoverflow.com/questions/tagged/react-native

https://stackoverflow.com/questions/55822449/errors-when-generating-release-apk-error-duplicate-resources-aapt-error-res

I was on stackoverflow but no response was good until now

How to solve this please ?

Ran Commands Locked Question

Most helpful comment

For me I had accidentally deleted android/app/src/main/res/values/strings.xml and android/app/src/main/res/values/styles.xml when replacing the app icons. Adding them back in fixed it.

Example strings.xml:

<resources>
    <string name="app_name">APP_NAME</string>
</resources>

Example styles.xml:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:textColor">#000000</item>
    </style>

</resources>

All 10 comments


We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

馃憠 Click here if you want to report a reproducible bug or regression in React Native.

As the Error Message says:

Android resource linking failed the files that are present in the values folder might not properly be linked up with AndroidManifest files

Check if the files present in values folder string, style, color, etc are properly mapped in AndroidManifest.xml

If no, then Map it.

Then run the following commands:
cd android
./gradlew clean
cd ..
and then run:
react-native run-android --variant=release

@Santu1245

What do you mean by "Map it"?

I'm having the same issue, it's been two days now, I've tried running gradlew clean and even going as far to delete my build folder.

When I first started the app it worked fine, but when I close out of it that's when it becomes an issue
and this type of error would always pop up:

Any permanent solution?

   Task :app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  C:\Users\ticis\Documents\tungtied\tungtied\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:14: AAPT: error: resource mipmap/ic_launcher (aka com.tungtied:mipmap/ic_launcher) not found.

  C:\Users\ticis\Documents\tungtied\tungtied\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:14: AAPT: error: resource string/app_name (aka com.tungtied:string/app_name) not found.

  C:\Users\ticis\Documents\tungtied\tungtied\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:14: AAPT: error: resource mipmap/ic_launcher_round (aka com.tungtied:mipmap/ic_launcher_round) not found.

  C:\Users\ticis\Documents\tungtied\tungtied\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:14: AAPT: error: resource style/AppTheme (aka com.tungtied:style/AppTheme) not found.

  C:\Users\ticis\Documents\tungtied\tungtied\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:24: AAPT: error: resource string/app_name (aka com.tungtied:string/app_name) not found.

  error: failed processing manifest.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 55s
32 actionable tasks: 29 executed, 3 up-to-date
error Failed to build the app. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat build -x lint
    at checkExecSyncError (child_process.js:629:11)
    at execFileSync (child_process.js:647:13)
    at buildApk (C:\Users\ticis\Documents\tungtied\tungtied\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:201:39)
    at runOnSpecificDevice (C:\Users\ticis\Documents\tungtied\tungtied\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:182:7)
    at buildAndRun (C:\Users\ticis\Documents\tungtied\tungtied\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:167:12)
    at then.result (C:\Users\ticis\Documents\tungtied\tungtied\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:135:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)
error Command failed with exit code 1.
info Visit http://yarnpkg.com/en/docs/cli/android for documentation about this command.

I'm having the same issue, someone can help?
Error

Can someone help with this? i am facing this issue too.

For me I had accidentally deleted android/app/src/main/res/values/strings.xml and android/app/src/main/res/values/styles.xml when replacing the app icons. Adding them back in fixed it.

Example strings.xml:

<resources>
    <string name="app_name">APP_NAME</string>
</resources>

Example styles.xml:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:textColor">#000000</item>
    </style>

</resources>

For my team, we had accidentally deleted android\app\src\main\res\mipmap-???dpi\ic_launcher_round.png
Restoring the files, resolve the issue.

Each folder in android/app/src/main/res must have ic_launcher.png & ic_launcher_round.png files

same problem the icons exist but cant't build can someone help i am stuck here i haven't slept for three days now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazywei picture lazywei  路  3Comments

TrakBit picture TrakBit  路  3Comments

grabbou picture grabbou  路  3Comments

despairblue picture despairblue  路  3Comments

axelg12 picture axelg12  路  3Comments