2

I am trying to run an app that has a Google Maps Activity on my phone. My phone's running on Android 4.1.3 and the Minimum SDK for my project is API 15: Android 4.0.3

I just created the project on Android Studio and tried to run it on my phone. But it won't run and I am keep getting this error. Can someone tell me how to solve this?

Check here to see the error I am getting

2 Answers2

0

That error probably means that you are using too much libraries. And because you are trying to use google maps I'm guessing you included everything google.

Try to just use the libraries you need. For maps use this:

dependencies {
    com.google.android.gms:play-services-maps:9.2.1
}

Reading material: https://developers.google.com/android/guides/setup

jbarat
  • 2,382
  • 21
  • 23
0

You need to configure your gradle for multidex.

Modify the module-level build.gradle file configuration to include the support library and enable multidex output, as shown in the following code snippet:

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.0"
defaultConfig {
    ...
    minSdkVersion 14
    targetSdkVersion 21
    ...

    // Enabling multidex support.
    multiDexEnabled true
}
...
}

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

See more on same link which you are refering : https://developer.android.com/studio/build/multidex.html#mdex-gradle

You can also see some related question for same error:

How to enable multidexing with the new Android Multidex support library

Android java.exe finished with non-zero exit value 1

Community
  • 1
  • 1
pRaNaY
  • 24,642
  • 24
  • 96
  • 146