简体   繁体   中英

Android project error

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?

检查这里以查看我得到的错误

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM