React-native-image-crop-picker: Android Error build(ios worked fine)

Created on 13 Sep 2017  路  3Comments  路  Source: ivpusic/react-native-image-crop-picker

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.16.1
  • react-native v0.47.2

Platform

  • Android

I got this error

`Execution failed for task ':app:transformClassesWithDexForDebug'.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536`

This is my project build gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.1.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"

        }
        maven {
            url 'https://maven.google.com'
        }
    }
}

App build gradle

`android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.innoveativestudio.hotpot"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }

    }
...
dependencies {

    compile(project(':react-native-firebase')) {
    transitive = false
    }

    compile 'com.google.firebase:firebase-core:11.0.4'
    compile 'com.google.firebase:firebase-auth:11.0.4'
    compile 'com.google.firebase:firebase-database:11.0.4'
    compile 'com.google.firebase:firebase-analytics:11.0.4'
    compile 'com.google.firebase:firebase-ads:11.0.4'
    compile 'com.google.firebase:firebase-storage:11.0.4'
    compile project(':react-native-firebase')
    compile project(':react-native-fast-image')
    compile project(':react-native-vector-icons')
    compile project(':react-native-svg')
    compile project(':react-native-facebook-login')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile 'com.google.android.gms:play-services-base:11.0.4'
    compile 'com.facebook.react:react-native:+'
    compile project(':react-native-image-crop-picker')


}

apply plugin: 'com.google.gms.google-services'`

Most helpful comment

After set multidex enabled, the issue sovled. But i don't know if this is a good approach.

`android {
    defaultConfig {
        ...

        multiDexEnabled true
    }
    ...
}

dependencies {
  compile 'com.android.support:multidex:1.0.1'
}`

All 3 comments

After set multidex enabled, the issue sovled. But i don't know if this is a good approach.

`android {
    defaultConfig {
        ...

        multiDexEnabled true
    }
    ...
}

dependencies {
  compile 'com.android.support:multidex:1.0.1'
}`

Had to do the same

link to #469

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xuchao321 picture xuchao321  路  3Comments

equesteo picture equesteo  路  3Comments

leelandclay picture leelandclay  路  3Comments

manojshrimalla picture manojshrimalla  路  3Comments

jmahatpure01 picture jmahatpure01  路  3Comments