简体   繁体   English

Android项目错误

[英]Android project error

I am trying to run an app that has a Google Maps Activity on my phone. 我正在尝试运行手机上具有Google Maps Activity的应用程序。 My phone's running on Android 4.1.3 and the Minimum SDK for my project is API 15: Android 4.0.3 我的手机在Android 4.1.3上运行,并且我的项目的最低SDK为API 15:Android 4.0.3

I just created the project on Android Studio and tried to run it on my phone. 我刚刚在Android Studio上创建了该项目,并尝试在手机上运行它。 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. 而且因为您正在尝试使用Google地图,所以我猜您已经包含了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 阅读材料: https : //developers.google.com/android/guides/setup

You need to configure your gradle for multidex. 您需要为multidex配置gradle。

Modify the module-level build.gradle file configuration to include the support library and enable multidex output, as shown in the following code snippet: 修改模块级别的build.gradle文件配置以包括支持库并启用multidex输出,如以下代码片段所示:

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 在您引用的同一链接上查看更多信息: 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 Multidex支持库启用多重排序

Android java.exe finished with non-zero exit value 1 Android java.exe完成,退出值非零1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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