Skip to content
This repository was archived by the owner on Apr 24, 2026. It is now read-only.
This repository was archived by the owner on Apr 24, 2026. It is now read-only.

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

Open

Description

@wliadmin

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

Activity

  1. celodauane commented on Jan 17, 2019

    @celodauane

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

  2. esutton commented on Apr 12, 2019

    @esutton

    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
    
  3. jbenzshawel commented on Oct 24, 2019

    @jbenzshawel

    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,
        },
     },
  4. Ben002 commented on Oct 28, 2019

    @Ben002

    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

  5. MahsaKarimi72 commented on Apr 28, 2020

    @MahsaKarimi72

    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?

  6. kevinmanncito commented on Jun 10, 2022

    @kevinmanncito

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions