[英]Disable minification and uglify in react-native release build for android
I have properly working in development environment react-native
application. 我已经在开发环境
react-native
应用程序中正常工作。 I wanted to test it's performance and released a build, which crashes after the launch. 我想测试它的性能并发布了一个在发布后崩溃的版本。
01-09 20:16:13.644 23215 23251 E ReactNativeJS: Object type 't' not found in schema.
01-09 20:16:13.648 23215 23251 E ReactNativeJS: Module AppRegistry is not a registered callable module (calling runApplication)
I couldn't determine the cause of crashing because of minification and uglify of the sources. 由于消息来源的缩小和丑化,我无法确定崩溃的原因。 Could you, please, help me with disabling it, because I already spent plenty of hours on it.
请你帮我禁用它,因为我已经花了很多时间。
react-native version: 0.49.5 react-native版本:0.49.5
putting --minify=false in extraPackagerArgs in android/app/build.gradle should do the job. 在android / app / build.gradle中的extraPackagerArgs中放置--minify = false应该可以完成这项工作。
project.ext.react = [
entryFile: "index.js",
extraPackagerArgs: [ '--minify=false' ],
];
I think you should first test your app by unchecking dev mode on your in app developer menu. 我认为您应首先在应用内开发人员菜单中取消选中开发模式来测试您的应用。
i had the same problem and it took me some time to figure out. 我有同样的问题,花了一些时间才弄明白。
i disabled the dev mode so it generates the JS bundle same like release bundle and i found the problem and fixed it. 我禁用了开发模式,因此它生成了与发布包相同的JS包,我发现了问题并修复了它。
If anyone got to here this might help: 如果有人到这里这可能会有所帮助:
node_modules/.bin/haul bundle --dev=false --config=node_modules/react-native-bundle-visualizer/src/webpack.haul.js
you can know more doing: 你可以知道更多:
node_modules/.bin/haul bundle --help
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.