Trying to make signed apk but getting error of duplicacy
See original GitHub issueIs 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:
- Created 6 years ago
- Comments:9 (2 by maintainers)
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
Now bundle assets using this command:
Note the updated
--assets-dest
in the above command. Assembling the APK worked ok after that!I deleted those original duplicate file manually from the drawable mdpi file and run ./gradlew assembleRelease again, the workaround worked.