question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to make signed apk but getting error of duplicacy

See original GitHub issue

Is this a bug report?

(yes this is a bug report)

This is a bug report of react native , i want to make a signed apk, Successfully all step is completed without any problem, the link i followed is ---> [signed](https://facebook.github.io/react-native/docs/signed-apk-android.html)

Have you read the Contributing Guidelines?

(Write your answer here.) Yes

Environment

Environment: OS: ubuntu 16.04lts Node: v7.10.1 npm: 4.2.0

Packages: (wanted => installed) react: 16.0.0-alpha.12, react-native: 0.48.1,

Target Platform: ubuntu 16.04lts

Steps to Reproduce

When i ran command cd android && ./gradlew assembleRelease after completing the Generating a signing key

Expected Behavior

It seems working fine

(Write what you thought would happen.)

Actual Behavior

Duplicacy error of image.

(Write what happened. Add screenshots!)

Reproducible Demo

`Incremental java compilation is an incubating feature. :app:preBuild UP-TO-DATE :app:preReleaseBuild UP-TO-DATE :app:checkReleaseManifest :app:preDebugBuild UP-TO-DATE :react-native-contacts:preBuild UP-TO-DATE :react-native-contacts:preReleaseBuild UP-TO-DATE :react-native-contacts:checkReleaseManifest :react-native-contacts:preDebugAndroidTestBuild UP-TO-DATE :react-native-contacts:preDebugBuild UP-TO-DATE :react-native-contacts:preDebugUnitTestBuild UP-TO-DATE :react-native-contacts:preReleaseUnitTestBuild UP-TO-DATE :react-native-contacts:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE :react-native-contacts:prepareComAndroidSupportSupportV42301Library UP-TO-DATE :react-native-contacts:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE :react-native-contacts:prepareComFacebookFrescoDrawee101Library UP-TO-DATE :react-native-contacts:prepareComFacebookFrescoFbcore101Library UP-TO-DATE :react-native-contacts:prepareComFacebookFrescoFresco101Library UP-TO-DATE :react-native-contacts:prepareComFacebookFrescoImagepipeline101Library UP-TO-DATE :react-native-contacts:prepareComFacebookFrescoImagepipelineBase101Library UP-TO-DATE :react-native-contacts:prepareComFacebookFrescoImagepipelineOkhttp3101Library UP-TO-DATE :react-native-contacts:prepareComFacebookReactReactNative0471Library UP-TO-DATE :react-native-contacts:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE :react-native-contacts:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE :react-native-contacts:prepareReleaseDependencies :react-native-contacts:compileReleaseAidl UP-TO-DATE :react-native-contacts:compileReleaseNdk UP-TO-DATE :react-native-contacts:compileLint UP-TO-DATE :react-native-contacts:copyReleaseLint UP-TO-DATE :react-native-contacts:compileReleaseRenderscript UP-TO-DATE :react-native-contacts:generateReleaseBuildConfig UP-TO-DATE :react-native-contacts:generateReleaseResValues UP-TO-DATE :react-native-contacts:generateReleaseResources UP-TO-DATE :react-native-contacts:mergeReleaseResources UP-TO-DATE :react-native-contacts:processReleaseManifest UP-TO-DATE :react-native-contacts:processReleaseResources UP-TO-DATE :react-native-contacts:generateReleaseSources UP-TO-DATE :react-native-contacts:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE :react-native-contacts:compileReleaseJavaWithJavac UP-TO-DATE :react-native-contacts:extractReleaseAnnotations UP-TO-DATE :react-native-contacts:mergeReleaseShaders UP-TO-DATE :react-native-contacts:compileReleaseShaders UP-TO-DATE :react-native-contacts:generateReleaseAssets UP-TO-DATE :react-native-contacts:mergeReleaseAssets UP-TO-DATE :react-native-contacts:mergeReleaseProguardFiles UP-TO-DATE :react-native-contacts:packageReleaseRenderscript UP-TO-DATE :react-native-contacts:packageReleaseResources UP-TO-DATE :react-native-contacts:processReleaseJavaRes UP-TO-DATE :react-native-contacts:transformResourcesWithMergeJavaResForRelease UP-TO-DATE :react-native-contacts:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE :react-native-contacts:mergeReleaseJniLibFolders UP-TO-DATE :react-native-contacts:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE :react-native-contacts:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE :react-native-contacts:bundleRelease UP-TO-DATE :react-native-vector-icons:preBuild UP-TO-DATE :react-native-vector-icons:preReleaseBuild UP-TO-DATE :react-native-vector-icons:checkReleaseManifest :react-native-vector-icons:preDebugAndroidTestBuild UP-TO-DATE :react-native-vector-icons:preDebugBuild UP-TO-DATE :react-native-vector-icons:preDebugUnitTestBuild UP-TO-DATE :react-native-vector-icons:preReleaseUnitTestBuild UP-TO-DATE :react-native-vector-icons:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE :react-native-vector-icons:prepareComAndroidSupportSupportV42301Library UP-TO-DATE :react-native-vector-icons:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE :react-native-vector-icons:prepareComFacebookFrescoDrawee101Library UP-TO-DATE :react-native-vector-icons:prepareComFacebookFrescoFbcore101Library UP-TO-DATE :react-native-vector-icons:prepareComFacebookFrescoFresco101Library UP-TO-DATE :react-native-vector-icons:prepareComFacebookFrescoImagepipeline101Library UP-TO-DATE :react-native-vector-icons:prepareComFacebookFrescoImagepipelineBase101Library UP-TO-DATE :react-native-vector-icons:prepareComFacebookFrescoImagepipelineOkhttp3101Library UP-TO-DATE :react-native-vector-icons:prepareComFacebookReactReactNative0471Library UP-TO-DATE :react-native-vector-icons:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE :react-native-vector-icons:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE :react-native-vector-icons:prepareReleaseDependencies :react-native-vector-icons:compileReleaseAidl UP-TO-DATE :react-native-vector-icons:compileReleaseNdk UP-TO-DATE :react-native-vector-icons:compileLint UP-TO-DATE :react-native-vector-icons:copyReleaseLint UP-TO-DATE :react-native-vector-icons:compileReleaseRenderscript UP-TO-DATE :react-native-vector-icons:generateReleaseBuildConfig UP-TO-DATE :react-native-vector-icons:generateReleaseResValues UP-TO-DATE :react-native-vector-icons:generateReleaseResources UP-TO-DATE :react-native-vector-icons:mergeReleaseResources UP-TO-DATE :react-native-vector-icons:processReleaseManifest UP-TO-DATE :react-native-vector-icons:processReleaseResources UP-TO-DATE :react-native-vector-icons:generateReleaseSources UP-TO-DATE :react-native-vector-icons:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE :react-native-vector-icons:compileReleaseJavaWithJavac UP-TO-DATE :react-native-vector-icons:extractReleaseAnnotations UP-TO-DATE :react-native-vector-icons:mergeReleaseShaders UP-TO-DATE :react-native-vector-icons:compileReleaseShaders UP-TO-DATE :react-native-vector-icons:generateReleaseAssets UP-TO-DATE :react-native-vector-icons:mergeReleaseAssets UP-TO-DATE :react-native-vector-icons:mergeReleaseProguardFiles UP-TO-DATE :react-native-vector-icons:packageReleaseRenderscript UP-TO-DATE :react-native-vector-icons:packageReleaseResources UP-TO-DATE :react-native-vector-icons:processReleaseJavaRes UP-TO-DATE :react-native-vector-icons:transformResourcesWithMergeJavaResForRelease UP-TO-DATE :react-native-vector-icons:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE :react-native-vector-icons:mergeReleaseJniLibFolders UP-TO-DATE :react-native-vector-icons:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE :react-native-vector-icons:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE :react-native-vector-icons:bundleRelease UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE :app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE :app:prepareComFacebookFrescoDrawee101Library UP-TO-DATE :app:prepareComFacebookFrescoFbcore101Library UP-TO-DATE :app:prepareComFacebookFrescoFresco101Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipeline101Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipelineBase101Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipelineOkhttp3101Library UP-TO-DATE :app:prepareComFacebookReactReactNative0471Library UP-TO-DATE :app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE :app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE :app:preparereactProjectsReactNativeContactsUnspecifiedLibrary UP-TO-DATE :app:preparereactProjectsReactNativeVectorIconsUnspecifiedLibrary UP-TO-DATE :app:prepareReleaseDependencies :app:compileReleaseAidl UP-TO-DATE :app:compileReleaseRenderscript UP-TO-DATE :app:generateReleaseBuildConfig UP-TO-DATE :app:mergeReleaseShaders UP-TO-DATE :app:compileReleaseShaders UP-TO-DATE :app:generateReleaseAssets UP-TO-DATE :app:mergeReleaseAssets :app:generateReleaseResValues UP-TO-DATE :app:generateReleaseResources UP-TO-DATE :app:mergeReleaseResources :app:bundleReleaseJsAndAssets Scanning 687 folders for symlinks in /home/sunny/projects/reactProjects/node_modules (17ms) Scanning 687 folders for symlinks in /home/sunny/projects/reactProjects/node_modules (46ms) Loading dependency graph, done. warning: the transform cache was reset.

Building 85% > :app:bundleReleaseJsAndAssets bundle: start bundle: finish bundle: Writing bundle output to: /home/sunny/projects/reactProjects/android/app/build/intermediates/assets/release/index.android.bundle bundle: Done writing bundle output bundle: Copying 17 asset files bundle: Done copying assets :app:processReleaseManifest UP-TO-DATE :app:processReleaseResources /home/sunny/projects/reactProjects/android/app/build/intermediates/res/merged/release/drawable-mdpi-v4/src_images_blurryblue.jpg: error: Duplicate file. /home/sunny/projects/reactProjects/android/app/build/intermediates/res/merged/release/drawable-mdpi/src_images_blurryblue.jpg: Original is here. The version qualifier may be implied.

:app:processReleaseResources FAILED

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ‘:app:processReleaseResources’. com.android.ide.common.process.ProcessException: Failed to execute aapt Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED

Total time: 2 mins 34.735 secs`

(Paste the link to an example project and exact instructions to reproduce the issue.)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
sujayjajucommented, Feb 26, 2018

The issue is that the new version of react-native bundles the assets under /app/build/intermediates/res/merged/release instead of app/src/main/res

To resolve it, this is what I did

rm -rf android/app/src/main/res/drawable-*

Now bundle assets using this command:

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/

Note the updated --assets-dest in the above command. Assembling the APK worked ok after that!

react-native run-android --variant=release
2reactions
choo737commented, Dec 11, 2017

I deleted those original duplicate file manually from the drawable mdpi file and run ./gradlew assembleRelease again, the workaround worked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Duplicate entry error while generating signed apk
I am get rid of this problem by updating each and every library with their updated versions. And previously I used google bundled...
Read more >
Duplicate Resources Error- React Native 0.60+ - Shreyas Nisal
Go to android/app/src/main/res and delete all the directories starting with drawables. This is similar to what we did for earlier versions of React...
Read more >
UnsupportedOperationException during generate signed apk ...
this morning i had updated version of Android Studio to 0.4.4. Now, i try to generate a signed apk, but in the Messages...
Read more >
Addressing common errors in React Native - LogRocket Blog
Go into {your-project-folder}/android/app/src/main/ folder and check if an assets folder exists within it. If the assets folder isn't already ...
Read more >
React Native Android Duplicate file error when generating apk
. I tried on the command line and android studio for the build. resources got duplicated. app:mergeReleaseResources [drawable-hdpi-v4/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found