Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable minification and uglify in react-native release build for android

I have properly working in development environment react-native application. 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

like image 747
Ali_run Avatar asked Jan 10 '18 09:01

Ali_run


2 Answers

putting --minify=false in extraPackagerArgs in android/app/build.gradle should do the job.

project.ext.react = [
    entryFile: "index.js",
    extraPackagerArgs: [ '--minify=false' ],
];
like image 196
Moritz Avatar answered Nov 13 '22 13:11

Moritz


You can accomplish this with the use of the CLI tool, Haul

Haul bundle --minify false should do the trick, if not, Haul provides other commands as well.

like image 2
richTheCreator Avatar answered Nov 13 '22 12:11

richTheCreator