React Native Android Duplicate file error when generating apk

后端 未结 8 1459
生来不讨喜
生来不讨喜 2020-11-30 20:30

When I am trying to generate android apk by using ./gradlew installRelease, I get this error in console:

~/React-Native/mockingbird/android/app/         


        
8条回答
  •  醉梦人生
    2020-11-30 21:21

    Do not run react-native bundle prior to ./gradlew assembleRelease.

    For myself, I was running react-native bundle prior to running ./gradlew assembleRelease.

    I was getting a similar duplicate error message with one of my assets.

    Looking at the ./gradlew assembleRelease output, I could tell that it builds the JS bundle by itself (thanks to apply from: "../node_modules/react-native/react.gradle" in your build.gradle file) so it was not necessary to manually run react-native bundle before hand.

    If I simply did not run react-native bundle before running ./gradlew assembleRelease everything worked great.

    I tested the Release APK and the JS bundle loads fine, including all images.

    My only concern is whether the source maps --sourcemap-output (for Bugsnag) will be created. If not, I'm sure there's a way to have ./gradlew assembleRelease generate those as well. I just have not tested it yet.

提交回复
热议问题