React-Native assembleRelease fails for task ':app:bundleReleaseJsAndAssets'

后端 未结 12 2012
借酒劲吻你
借酒劲吻你 2020-12-13 02:24

When I run ./gradlew assembleRelease build is failed with this error:

Error:Execution failed for task \':app:bundleReleaseJsAndAsse         


        
12条回答
  •  死守一世寂寞
    2020-12-13 03:10

    As of RN 0.58, for CI builds the commands is as follows:

    First create directories:

    mkdir -p app/build/generated/assets/react/production/release/ && mkdir -p app/build/generated/res/react/production/release

    Next:

    node ../node_modules/react-native/local-cli/cli.js bundle --platform android --dev false --entry-file index.android.js --bundle-output app/build/generated/assets/react/production/release/index.android.bundle --assets-dest app/build/generated/res/react/production/release --max-workers 1 --reset-cache

    Also you may also want to add for your production builds according to this;

    --minify true

    Taken from RN's source

    NOTE: We added --max-workers 1 not to deplete CI resources since they are limited to lower numbers (mem&cpu).

提交回复
热议问题