React native app is multiple dex with over 65536 methods












0















I am programming react native app on android. When I run on android, it show error: multiple dex with over 65536 methods.
Here is android/app/build.gradle:



dependencies {
compile project(':react-native-device-info')
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile project(':react-native-fbsdk')
compile(project(':react-native-firebase')) {
exclude group: "com.google.firebase"
}
compile project(':bugsnag-react-native')
compile(project(':react-native-push-notification')) {
}
compile project(':react-native-vector-icons')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.facebook.react:react-native:+'
// From node_modules
compile('com.google.firebase:firebase-core:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-config:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-auth:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-database:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-storage:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-messaging:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-crash:10.2.6') {
force = true;
}
compile('com.google.android.gms:play-services-gcm:10.2.6') {
force = true;
}
compile project(':react-native-onesignal')
compile project(':react-native-fast-image')
compile project(':react-native-camera')
compile project(':RNWebView')
compile project(':zpdk-production')


}



android/build.gradle



buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}


}



file package.json



"dependencies": {
"async": "^2.5.0",
"bugsnag-react-native": "^2.2.0",
"he": "^1.1.1",
"moment": "^2.18.1",
"oauth-1.0a": "^2.1.0",
"prop-types": "^15.5.10",
"react": "16.0.0-alpha.12",
"react-native": "0.48.3",
"react-native-camera": "^0.13.0",
"react-native-datepicker": "^1.4.7",
"react-native-device-info": "^0.11.0",
"react-native-drawer": "^2.3.0",
"react-native-fast-image": "^1.0.0",
"react-native-fbsdk": "^0.6.1",
"react-native-firebase": "1.1.2",
"react-native-image-progress": "^1.0.1",
"react-native-keyboard-aware-scroll-view": "^0.2.7",
"react-native-modal-dropdown": "^0.4.2",
"react-native-navbar": "^1.5.0",
"react-native-onesignal": "^3.0.6",
"react-native-progress": "^3.4.0",
"react-native-push-notification": "^2.2.1",
"react-native-root-toast": "^1.0.3",
"react-native-router-flux": "^3.37.0",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-swiper": "^1.5.12",
"react-native-vector-icons": "^4.0.0",
"react-native-webview-android": "^1.1.17",
"react-navigation": "^1.0.0-beta.11",
"react-redux": "^5.0.3",
"redux": "^3.7.2",
"redux-logger": "^2.6.1",
"redux-persist": "^4.9.1",
"redux-thunk": "^2.1.0"


},



In react-native-firebase, I only use anlytics to log events of user who use my app.
I don't know which dependencies I should remove. Please help me with my issue.



I tried enable multiple dex. But when I run app -> login with facebook -> app is crashed.



My config multidex. I consider I am missing some configuration.



android/app/build.gradle



 defaultConfig {
applicationId "com.vannguyen.demotest"
minSdkVersion 16
targetSdkVersion 25
versionCode 15
versionName "1.1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}

multiDexEnabled true
}


In MainApplication.java:



public class MainApplication extends MultiDexApplication implements ReactApplication {


Thank you so much.










share|improve this question

























  • I tried enable multiple dex. But when I run app -> login with facebook -> app is crashed. Thank you so much. Why does your app crash?

    – ZUNJAE
    Nov 13 '18 at 10:10











  • I received error message: Exception in native call java.lang.RuntimeException: could not invoke FBGraphRequest.start

    – vannguyen
    Nov 13 '18 at 10:22
















0















I am programming react native app on android. When I run on android, it show error: multiple dex with over 65536 methods.
Here is android/app/build.gradle:



dependencies {
compile project(':react-native-device-info')
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile project(':react-native-fbsdk')
compile(project(':react-native-firebase')) {
exclude group: "com.google.firebase"
}
compile project(':bugsnag-react-native')
compile(project(':react-native-push-notification')) {
}
compile project(':react-native-vector-icons')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.facebook.react:react-native:+'
// From node_modules
compile('com.google.firebase:firebase-core:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-config:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-auth:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-database:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-storage:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-messaging:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-crash:10.2.6') {
force = true;
}
compile('com.google.android.gms:play-services-gcm:10.2.6') {
force = true;
}
compile project(':react-native-onesignal')
compile project(':react-native-fast-image')
compile project(':react-native-camera')
compile project(':RNWebView')
compile project(':zpdk-production')


}



android/build.gradle



buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}


}



file package.json



"dependencies": {
"async": "^2.5.0",
"bugsnag-react-native": "^2.2.0",
"he": "^1.1.1",
"moment": "^2.18.1",
"oauth-1.0a": "^2.1.0",
"prop-types": "^15.5.10",
"react": "16.0.0-alpha.12",
"react-native": "0.48.3",
"react-native-camera": "^0.13.0",
"react-native-datepicker": "^1.4.7",
"react-native-device-info": "^0.11.0",
"react-native-drawer": "^2.3.0",
"react-native-fast-image": "^1.0.0",
"react-native-fbsdk": "^0.6.1",
"react-native-firebase": "1.1.2",
"react-native-image-progress": "^1.0.1",
"react-native-keyboard-aware-scroll-view": "^0.2.7",
"react-native-modal-dropdown": "^0.4.2",
"react-native-navbar": "^1.5.0",
"react-native-onesignal": "^3.0.6",
"react-native-progress": "^3.4.0",
"react-native-push-notification": "^2.2.1",
"react-native-root-toast": "^1.0.3",
"react-native-router-flux": "^3.37.0",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-swiper": "^1.5.12",
"react-native-vector-icons": "^4.0.0",
"react-native-webview-android": "^1.1.17",
"react-navigation": "^1.0.0-beta.11",
"react-redux": "^5.0.3",
"redux": "^3.7.2",
"redux-logger": "^2.6.1",
"redux-persist": "^4.9.1",
"redux-thunk": "^2.1.0"


},



In react-native-firebase, I only use anlytics to log events of user who use my app.
I don't know which dependencies I should remove. Please help me with my issue.



I tried enable multiple dex. But when I run app -> login with facebook -> app is crashed.



My config multidex. I consider I am missing some configuration.



android/app/build.gradle



 defaultConfig {
applicationId "com.vannguyen.demotest"
minSdkVersion 16
targetSdkVersion 25
versionCode 15
versionName "1.1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}

multiDexEnabled true
}


In MainApplication.java:



public class MainApplication extends MultiDexApplication implements ReactApplication {


Thank you so much.










share|improve this question

























  • I tried enable multiple dex. But when I run app -> login with facebook -> app is crashed. Thank you so much. Why does your app crash?

    – ZUNJAE
    Nov 13 '18 at 10:10











  • I received error message: Exception in native call java.lang.RuntimeException: could not invoke FBGraphRequest.start

    – vannguyen
    Nov 13 '18 at 10:22














0












0








0








I am programming react native app on android. When I run on android, it show error: multiple dex with over 65536 methods.
Here is android/app/build.gradle:



dependencies {
compile project(':react-native-device-info')
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile project(':react-native-fbsdk')
compile(project(':react-native-firebase')) {
exclude group: "com.google.firebase"
}
compile project(':bugsnag-react-native')
compile(project(':react-native-push-notification')) {
}
compile project(':react-native-vector-icons')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.facebook.react:react-native:+'
// From node_modules
compile('com.google.firebase:firebase-core:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-config:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-auth:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-database:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-storage:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-messaging:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-crash:10.2.6') {
force = true;
}
compile('com.google.android.gms:play-services-gcm:10.2.6') {
force = true;
}
compile project(':react-native-onesignal')
compile project(':react-native-fast-image')
compile project(':react-native-camera')
compile project(':RNWebView')
compile project(':zpdk-production')


}



android/build.gradle



buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}


}



file package.json



"dependencies": {
"async": "^2.5.0",
"bugsnag-react-native": "^2.2.0",
"he": "^1.1.1",
"moment": "^2.18.1",
"oauth-1.0a": "^2.1.0",
"prop-types": "^15.5.10",
"react": "16.0.0-alpha.12",
"react-native": "0.48.3",
"react-native-camera": "^0.13.0",
"react-native-datepicker": "^1.4.7",
"react-native-device-info": "^0.11.0",
"react-native-drawer": "^2.3.0",
"react-native-fast-image": "^1.0.0",
"react-native-fbsdk": "^0.6.1",
"react-native-firebase": "1.1.2",
"react-native-image-progress": "^1.0.1",
"react-native-keyboard-aware-scroll-view": "^0.2.7",
"react-native-modal-dropdown": "^0.4.2",
"react-native-navbar": "^1.5.0",
"react-native-onesignal": "^3.0.6",
"react-native-progress": "^3.4.0",
"react-native-push-notification": "^2.2.1",
"react-native-root-toast": "^1.0.3",
"react-native-router-flux": "^3.37.0",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-swiper": "^1.5.12",
"react-native-vector-icons": "^4.0.0",
"react-native-webview-android": "^1.1.17",
"react-navigation": "^1.0.0-beta.11",
"react-redux": "^5.0.3",
"redux": "^3.7.2",
"redux-logger": "^2.6.1",
"redux-persist": "^4.9.1",
"redux-thunk": "^2.1.0"


},



In react-native-firebase, I only use anlytics to log events of user who use my app.
I don't know which dependencies I should remove. Please help me with my issue.



I tried enable multiple dex. But when I run app -> login with facebook -> app is crashed.



My config multidex. I consider I am missing some configuration.



android/app/build.gradle



 defaultConfig {
applicationId "com.vannguyen.demotest"
minSdkVersion 16
targetSdkVersion 25
versionCode 15
versionName "1.1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}

multiDexEnabled true
}


In MainApplication.java:



public class MainApplication extends MultiDexApplication implements ReactApplication {


Thank you so much.










share|improve this question
















I am programming react native app on android. When I run on android, it show error: multiple dex with over 65536 methods.
Here is android/app/build.gradle:



dependencies {
compile project(':react-native-device-info')
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile project(':react-native-fbsdk')
compile(project(':react-native-firebase')) {
exclude group: "com.google.firebase"
}
compile project(':bugsnag-react-native')
compile(project(':react-native-push-notification')) {
}
compile project(':react-native-vector-icons')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.facebook.react:react-native:+'
// From node_modules
compile('com.google.firebase:firebase-core:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-config:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-auth:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-database:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-storage:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-messaging:10.2.6') {
force = true;
}
compile('com.google.firebase:firebase-crash:10.2.6') {
force = true;
}
compile('com.google.android.gms:play-services-gcm:10.2.6') {
force = true;
}
compile project(':react-native-onesignal')
compile project(':react-native-fast-image')
compile project(':react-native-camera')
compile project(':RNWebView')
compile project(':zpdk-production')


}



android/build.gradle



buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}


}



file package.json



"dependencies": {
"async": "^2.5.0",
"bugsnag-react-native": "^2.2.0",
"he": "^1.1.1",
"moment": "^2.18.1",
"oauth-1.0a": "^2.1.0",
"prop-types": "^15.5.10",
"react": "16.0.0-alpha.12",
"react-native": "0.48.3",
"react-native-camera": "^0.13.0",
"react-native-datepicker": "^1.4.7",
"react-native-device-info": "^0.11.0",
"react-native-drawer": "^2.3.0",
"react-native-fast-image": "^1.0.0",
"react-native-fbsdk": "^0.6.1",
"react-native-firebase": "1.1.2",
"react-native-image-progress": "^1.0.1",
"react-native-keyboard-aware-scroll-view": "^0.2.7",
"react-native-modal-dropdown": "^0.4.2",
"react-native-navbar": "^1.5.0",
"react-native-onesignal": "^3.0.6",
"react-native-progress": "^3.4.0",
"react-native-push-notification": "^2.2.1",
"react-native-root-toast": "^1.0.3",
"react-native-router-flux": "^3.37.0",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-swiper": "^1.5.12",
"react-native-vector-icons": "^4.0.0",
"react-native-webview-android": "^1.1.17",
"react-navigation": "^1.0.0-beta.11",
"react-redux": "^5.0.3",
"redux": "^3.7.2",
"redux-logger": "^2.6.1",
"redux-persist": "^4.9.1",
"redux-thunk": "^2.1.0"


},



In react-native-firebase, I only use anlytics to log events of user who use my app.
I don't know which dependencies I should remove. Please help me with my issue.



I tried enable multiple dex. But when I run app -> login with facebook -> app is crashed.



My config multidex. I consider I am missing some configuration.



android/app/build.gradle



 defaultConfig {
applicationId "com.vannguyen.demotest"
minSdkVersion 16
targetSdkVersion 25
versionCode 15
versionName "1.1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}

multiDexEnabled true
}


In MainApplication.java:



public class MainApplication extends MultiDexApplication implements ReactApplication {


Thank you so much.







android firebase react-native android-multidex react-native-firebase






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 10:26







vannguyen

















asked Nov 13 '18 at 10:07









vannguyenvannguyen

76110




76110













  • I tried enable multiple dex. But when I run app -> login with facebook -> app is crashed. Thank you so much. Why does your app crash?

    – ZUNJAE
    Nov 13 '18 at 10:10











  • I received error message: Exception in native call java.lang.RuntimeException: could not invoke FBGraphRequest.start

    – vannguyen
    Nov 13 '18 at 10:22



















  • I tried enable multiple dex. But when I run app -> login with facebook -> app is crashed. Thank you so much. Why does your app crash?

    – ZUNJAE
    Nov 13 '18 at 10:10











  • I received error message: Exception in native call java.lang.RuntimeException: could not invoke FBGraphRequest.start

    – vannguyen
    Nov 13 '18 at 10:22

















I tried enable multiple dex. But when I run app -> login with facebook -> app is crashed. Thank you so much. Why does your app crash?

– ZUNJAE
Nov 13 '18 at 10:10





I tried enable multiple dex. But when I run app -> login with facebook -> app is crashed. Thank you so much. Why does your app crash?

– ZUNJAE
Nov 13 '18 at 10:10













I received error message: Exception in native call java.lang.RuntimeException: could not invoke FBGraphRequest.start

– vannguyen
Nov 13 '18 at 10:22





I received error message: Exception in native call java.lang.RuntimeException: could not invoke FBGraphRequest.start

– vannguyen
Nov 13 '18 at 10:22












1 Answer
1






active

oldest

votes


















0














You should enable multidex library in a project: open {project root}/android/app/build.gradle, then add following lines:



android {
...
defaultConfig {
...
multiDexEnabled true
}
}


And (if your sdk is lower than 21)



dependencies {
...
compile 'com.android.support:multidex:1.0.0'
...
}


Hope it helps. More info you could fine here.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53278522%2freact-native-app-is-multiple-dex-with-over-65536-methods%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You should enable multidex library in a project: open {project root}/android/app/build.gradle, then add following lines:



    android {
    ...
    defaultConfig {
    ...
    multiDexEnabled true
    }
    }


    And (if your sdk is lower than 21)



    dependencies {
    ...
    compile 'com.android.support:multidex:1.0.0'
    ...
    }


    Hope it helps. More info you could fine here.






    share|improve this answer






























      0














      You should enable multidex library in a project: open {project root}/android/app/build.gradle, then add following lines:



      android {
      ...
      defaultConfig {
      ...
      multiDexEnabled true
      }
      }


      And (if your sdk is lower than 21)



      dependencies {
      ...
      compile 'com.android.support:multidex:1.0.0'
      ...
      }


      Hope it helps. More info you could fine here.






      share|improve this answer




























        0












        0








        0







        You should enable multidex library in a project: open {project root}/android/app/build.gradle, then add following lines:



        android {
        ...
        defaultConfig {
        ...
        multiDexEnabled true
        }
        }


        And (if your sdk is lower than 21)



        dependencies {
        ...
        compile 'com.android.support:multidex:1.0.0'
        ...
        }


        Hope it helps. More info you could fine here.






        share|improve this answer















        You should enable multidex library in a project: open {project root}/android/app/build.gradle, then add following lines:



        android {
        ...
        defaultConfig {
        ...
        multiDexEnabled true
        }
        }


        And (if your sdk is lower than 21)



        dependencies {
        ...
        compile 'com.android.support:multidex:1.0.0'
        ...
        }


        Hope it helps. More info you could fine here.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 13 '18 at 11:24

























        answered Nov 13 '18 at 11:15









        Georgiy T.Georgiy T.

        36449




        36449






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53278522%2freact-native-app-is-multiple-dex-with-over-65536-methods%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Error while running script in elastic search , gateway timeout

            Adding quotations to stringified JSON object values