React Native Duplicate resources

前端 未结 8 659
感情败类
感情败类 2020-12-06 06:10

After upgrading to React Native 0.57 i am facing an issue when genrating APK in react-native-router-flux.when executing the .\\gradlew assembleRelease i get below error :-<

8条回答
  •  半阙折子戏
    2020-12-06 06:35

    react.gradle automatically build your javascript and copy any resources imported inside your javascript to the build folder so make sure to NOT call react-native bundle manually and delete any files or folder as src/main/res/drawable-* and src/main/assets/*.bundle and have the following changes into your app/bundle.gradle

    project.ext.react = [
      entryFile      : "index.js", // or index.android.js
      bundleInRelease: true,
      bundleInDebug: true
    ]
    
    apply from: "../../node_modules/react-native/react.gradle"
    

    Note: please notice that some react-native versions have a problem with the local cli.js please make sure to upgrade to a newer version or try adding the following config

     project.ext.react = [
        // ...
        cliPath: "node_modules/react-native/local-cli/cli.js"
     ]
    

提交回复
热议问题