Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Generating APK release AAPT: error: resource string/app_name #24587

Closed
maelfosso opened this issue Apr 24, 2019 · 10 comments
Closed

Error Generating APK release AAPT: error: resource string/app_name #24587

maelfosso opened this issue Apr 24, 2019 · 10 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Type: Question Issues that are actually questions and not bug reports.

Comments

@maelfosso
Copy link

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 ?

@maelfosso maelfosso added the Type: Question Issues that are actually questions and not bug reports. label Apr 24, 2019
@react-native-bot
Copy link
Collaborator

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.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: No Template labels Apr 24, 2019
@Santu1245
Copy link

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

@wcisco17
Copy link

wcisco17 commented Aug 1, 2019

@Santu1245

What do you mean by "Map it"?

@wcisco17
Copy link

wcisco17 commented Aug 1, 2019

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.

@luk3skyw4lker
Copy link

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

@SiddharthRana
Copy link

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

@BrianH2
Copy link

BrianH2 commented Sep 11, 2019

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>

@billygl
Copy link

billygl commented Sep 19, 2019

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

@utknit05
Copy link

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

@lylest
Copy link

lylest commented Apr 20, 2020

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

@facebook facebook locked as resolved and limited conversation to collaborators Apr 24, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Type: Question Issues that are actually questions and not bug reports.
Projects
None yet
Development

No branches or pull requests

10 participants