./ gradlew assembleRelease不会捆绑代码更改,除非我 运行脚本:
react-native bundle --platform android --dev false --entry-file
index.js --bundle-output
android/app/src/main/assets/index.android.bundle --assets-dest
android/app/src/main/res
react.gradle已应用到app / build.gradle文件
project.ext.react = [
entryFile: "index.js",
jsBundleDirRelease: "$buildDir/intermediates/assets/release",
bundleInDebug : false,
bundleInRelease : true,
root : "../.."
]
apply from: "../../node_modules/react-native/react.gradle"
我的package.json文件如下:
"dependencies": {
"apisauce": "0.14.3",
"appcenter": "1.12.0",
"appcenter-analytics": "1.12.0",
"appcenter-crashes": "1.12.0",
"appcenter-push": "1.12.0",
"create-react-class": "15.6.3",
"fastlane": "0.1.0",
"format-json": "1.0.3",
"identity-obj-proxy": "3.0.0",
"immutable": "4.0.0-rc.12",
"immutable-sort": "0.1.0",
"lodash": "4.17.10",
"moment": "2.22.1",
"native-base": "^2.12.1",
"path": "0.12.7",
"prop-types": "15.6.1",
"querystringify": "2.0.0",
"ramda": "0.25.0",
"react": "16.6.3",
"react-native": "0.58.3",
"react-native-animatable": "1.2.4",
"react-native-calendar-events": "1.5.0",
"react-native-chooser": "1.7.0",
"react-native-cli": "2.0.1",
"react-native-collapsible": "0.11.3",
"react-native-communications": "2.2.1",
"react-native-config": "0.11.5",
"react-native-datepicker": "1.7.2",
"react-native-device-info": "0.21.5",
"react-native-elements": "0.19.1",
"react-native-image-picker": "0.26.10",
"react-native-material-dropdown": "0.11.1",
"react-native-modal-dropdown": "0.6.2",
"react-native-modalbox": "^1.7.1",
"react-native-path": "0.0.5",
"react-native-picker": "4.3.7",
"react-native-picker-select": "3.1.2",
"react-native-radio-buttons": "1.0.0",
"react-native-segmented-control-tab": "3.2.2",
"react-native-simple-toast": "0.0.8",
"react-native-splash-screen": "3.0.6",
"react-native-swipeable": "0.6.0",
"react-native-user-avatar": "1.0.3",
"react-native-uuid": "1.4.9",
"react-native-vector-icons": "4.6.0",
"react-navigation": "1.5.8",
"react-navigation-redux-helpers": "1.0.3",
"react-redux": "5.0.7",
"redux": "4.0.0",
"redux-form": "7.3.0",
"redux-form-submit-saga": "1.2.1",
"redux-logger": "3.0.6",
"redux-persist": "5.9.1",
"redux-saga": "0.16.0",
"reduxsauce": "1.0.0",
"reselect": "3.0.1",
"schedule": "0.4.0",
"seamless-immutable": "7.1.4",
"standard": "11.0.1",
"to-sentence-case": "1.0.0",
"uuid": "3.3.2"
},
"devDependencies": {
"@storybook/addon-storyshots": "3.4.7",
"@storybook/addons": "3.4.7",
"@storybook/channels": "3.4.7",
"@storybook/react-native": "3.4.7",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "8.2.3",
"babel-jest": "24.0.0",
"babel-plugin-ignite-ignore-reactotron": "0.3.0",
"babel-preset-env": "1.7.0",
"babel-preset-react-native": "5.0.0",
"enzyme": "3.3.0",
"enzyme-adapter-react-16": "1.1.1",
"husky": "0.14.3",
"ignite-animatable": "1.0.0",
"ignite-ir-boilerplate": "2.3.1",
"ignite-redux-persist": "1.1.0",
"ignite-standard": "1.0.0",
"ignite-vector-icons": "1.1.0",
"jest": "24.0.0",
"mockery": "2.1.0",
"react-dom": "16.3.2",
"react-test-renderer": "16.6.3",
"reactotron-apisauce": "1.13.0",
"reactotron-react-native": "1.14.0",
"reactotron-redux": "1.13.0",
"reactotron-redux-saga": "1.13.0",
"snazzy": "7.1.1"
},
"standard": {
"parser": "babel-eslint",
"ignore": [
"node_modules/**"
],
"globals": [
"describe",
"test",
"jest",
"expect",
"fetch",
"navigator",
"__DEV__",
"XMLHttpRequest",
"FormData",
"React$Element"
]
},
"jest": {
"testMatch": [
"<rootDir>/Tests/**/*.js",
"**/?(*.)(spec|test).js?(x)"
],
"testPathIgnorePatterns": [
"/node_modules/",
"<rootDir>/Tests/Setup.js"
],
"moduleNameMapper": {
".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "identity-obj-proxy"
},
"setupFiles": [
"<rootDir>/Tests/Setup"
],
"preset": "react-native"
},
"config": {
"ghooks": {
"pre-commit": "if [ -d 'ignite-base' ]; then cd ignite-base; fi; yarn run lint"
}
}
}
每次都运行脚本非常乏味且容易出错。不能将我所缺少的内容归零。我有另一个项目没有这个问题