Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database operations are not working when i run in release mode :( #2

Open
wliadmin opened this issue Nov 22, 2018 · 6 comments
Open

Comments

@wliadmin
Copy link

Database operations are not working in release mode

Steps to reproduce

-> Run this demo by archiving application in iOS
-> Database operations are not performing in release mode

Expected behaviour

-> All the database operations should be performed

@celodauane
Copy link

@wliadmin where you able to find a solution for this issue?

@esutton
Copy link

esutton commented Apr 12, 2019

I cannot get https://github.com/typeorm/react-native-example/ to run on either Android or iOS with or without metro-minify-terser

Try https://github.com/sheva007/typeorm-boilerplate/

This runs on iOS debug/release and Android in simulator in debug mode. On iOS I wen to select "Legacy Build" from Xcode > File > Project Settings

I cannot get an Android release build to run?

Perhaps an issue with signing setup?

react-native run-android --variant=release
info JS server already running.
info Building and installing the app on the device (cd android && ./gradlew app:installRelease)...

FAILURE: Build failed with an exception.

* What went wrong:
Task 'installRelease' not found in project ':app'. Some candidates are: 'uninstallRelease'.

A debug build runs fine on Android simulator:

react-native run-android

@jbenzshawel
Copy link

This issue is due to minification in release mode changing class names and file names. It can be fixed with the following steps:

  1. yarn add metro-minify-terser
  2. Update the metro config to keep class names and file names. Add the following to the metro.config.js transformer:
minifierPath: 'metro-minify-terser',
minifierConfig: {
    ecma: 8,
    keep_classnames: true,
    keep_fnames: true,
    module: true,
    mangle: {
        module: true,
        keep_classnames: true,
        keep_fnames: true,
    },
 },

@Ben002
Copy link

Ben002 commented Oct 28, 2019

This issue is due to minification in release mode changing class names and file names. It can be fixed with the following steps:

  1. yarn add metro-minify-terser
  2. Update the metro config to keep class names and file names. Add the following to the metro.config.js transformer:
minifierPath: 'metro-minify-terser',
minifierConfig: {
    ecma: 8,
    keep_classnames: true,
    keep_fnames: true,
    module: true,
    mangle: {
        module: true,
        keep_classnames: true,
        keep_fnames: true,
    },
 },

thank you!
It's very useful to me

@MahsaKarimi72
Copy link

This issue is due to minification in release mode changing class names and file names. It can be fixed with the following steps:

  1. yarn add metro-minify-terser
  2. Update the metro config to keep class names and file names. Add the following to the metro.config.js transformer:
minifierPath: 'metro-minify-terser',
minifierConfig: {
    ecma: 8,
    keep_classnames: true,
    keep_fnames: true,
    module: true,
    mangle: {
        module: true,
        keep_classnames: true,
        keep_fnames: true,
    },
 },

I tried this solution but the problem has not been solved yet
can you help me pls?

@kevinmanncito
Copy link

Changing the minifier config didn't work for me (react native version 0.67). However, I was able to get it working in release builds by explicitly setting table names in the entity decorator:

@Entity({ name: "my_table_name" })
class MyTableName {

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants