Android Studio当包含.aar模块其错误:执行失败的任务':app:processDebugManifest'。[Duplicat]

问题描述:

当我在android studio中包含编译项目(':telrlibrary-release-1')aar模块。这引起以下错误Android Studio当包含.aar模块其错误:执行失败的任务':app:processDebugManifest'。[Duplicat]

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] 
Error:Execution failed for task ':app:processDebugManifest'.> Manifest merger failed with multiple errors, see logs 

这里的我的主要项目建设的gradle点文件。我包括项目编制项目( ':telrlibrary释放-1'),它使主体工程的错误

buildscript { 
repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 

dependencies { 
    classpath 'io.fabric.tools:gradle:1.+' 
} 
} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 

repositories { 
maven { url 'https://maven.fabric.io/public' } 
} 


android { 
lintOptions { 
    abortOnError false 
} 
signingConfigs { 
    config { 
     keyAlias 'rrrrr_app' 
     keyPassword 'rrrrr' 
     storeFile file('/home/apps/Desktop/Build/androidkey.jks') 
     storePassword 'jhgjhgj' 
    } 
} 
dexOptions { 
    javaMaxHeapSize "4g" 
    preDexLibraries = false 
} 
compileSdkVersion 25 
buildToolsVersion "25.0.3" 

defaultConfig { 
    multiDexEnabled = true 
    applicationId "com.rrrrr.app" 
    minSdkVersion 15 
    targetSdkVersion 23 
    versionCode 7 
    versionName "1.6" 

} 

productFlavors { 
} 
packagingOptions { 

    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/license.txt' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/NOTICE.txt' 
    exclude 'META-INF/notice.txt' 
    exclude 'META-INF/ASL2.0' 

} 
buildTypes { 
    release { 
     signingConfig signingConfigs.config 
     minifyEnabled false 
     debuggable false 
     jniDebuggable false 
     renderscriptDebuggable false 
     zipAlignEnabled true 
     proguardFile '/home/apps/Projects/app/proguard-rules.pro' 
    } 
} 
} 

dependencies { 

compile fileTree(include: ['*.jar'], dir: 'libs') 

compile project(':telrlibrary-release-1') 
compile files('libs/twitter4j-core-4.0.3.jar') 
androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE' 
compile('org.simpleframework:simple-xml:2.7.1', { 
    exclude group: 'stax', module: 'stax' 
    exclude group: 'stax', module: 'stax-api' 
    exclude group: 'xpp3', module: 'xpp3' 
}) 
compile 'com.koushikdutta.ion:ion:2.1.6' 
compile 'com.facebook.android:facebook-android-sdk:4.9.0' 
compile 'com.android.support:design:23.1.1' 
compile 'com.android.support:support-v4:23.1.1' 
compile 'com.google.android.gms:play-services:8.4.0' 
compile 'net.simonvt.menudrawer:menudrawer:3.0.6' 
compile 'com.android.support:multidex:1.0.0' 
compile 'com.google.android.gms:play-services-auth:8.4.0' 
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' 
compile 'com.google.android.gms:play-services-maps:8.4.0' 
compile 'com.firebase:firebase-client-android:2.5.0' 
/* compile 'com.paypal.sdk:paypal-android-sdk:2.13.3'*/ 
compile 'com.squareup.picasso:picasso:2.5.2' 
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
    transitive = true; 
} 
testCompile 'junit:junit:4.12' 
} 

清单

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:tools="http://schemas.android.com/tools" 
     package="com.rrrrr.app"> 

<uses-sdk android:targetSdkVersion="23"/> 

<uses-permission android:name="android.permission.INTERNET"/> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> 
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/> 
<uses-permission android:name="android.permission.GET_ACCOUNTS"/> 
<uses-permission android:name="android.permission.USE_CREDENTIALS"/> 
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> 
<uses-permission android:name="android.permission.WAKE_LOCK"/> 
<uses-permission android:name="android.permission.VIBRATE"/> 
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> 
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> 
<uses-permission android:name="android.permission.CAMERA"/> 
<uses-permission android:name="android.permission.CALL_PHONE"/> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> 
<uses-permission android:name="android.permission.GET_TASKS"/> 

<uses-feature 
    android:name="android.hardware.camera" 
    android:required="false"/> 
<uses-feature 
    android:name="android.hardware.camera.autofocus" 
    android:required="false"/> 

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> 

<permission 
    android:name="com.rrrrr.app.permission.C2D_MESSAGE" 
    android:protectionLevel="signature"/> 

<uses-permission android:name="com.rrrrr.app.permission.C2D_MESSAGE"/> 
<uses-permission android:name="android.permission.C2D_MESSAGE"/> 

<supports-screens 
    android:anyDensity="true" 
    android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true"/> 

<!-- android:supportsRtl="true" --> 
<application 
    android:name=".helper.rrrrr" 
    android:allowBackup="true" 
    android:hardwareAccelerated="true" 
    android:icon="@mipmap/appicon" 
    android:label="@string/app_name" 
    android:largeHeap="true" 
    android:supportsRtl="true" 
    android:theme="@style/MyMaterialTheme"> 
    <meta-data 
     android:name="com.facebook.sdk.ApplicationId" 
     android:value="@string/app_id" 
     tools:ignore="ManifestResource"/> 
    <meta-data 
     android:name="com.google.android.gms.version" 
     android:value="@integer/google_play_services_version"/> 

    <activity 
     android:name="com.facebook.FacebookActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" 
     android:label="@string/app_name" 
     android:screenOrientation="portrait" 
     android:theme="@android:style/Theme.Translucent.NoTitleBar"/> 
    <activity 
     android:name=".activity.HomeActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:label="@string/app_name" 
     android:screenOrientation="portrait" 
     android:theme="@android:style/Theme.Holo.Light.NoActionBar" 
     android:windowSoftInputMode="adjustNothing"> 
     <intent-filter> 
      <action android:name="android.intent.action.SEND_MULTIPLE"/> 

      <category android:name="android.intent.category.DEFAULT"/> 

      <data android:mimeType="image/*"/> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".activity.SplashActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN"/> 

      <category android:name="android.intent.category.LAUNCHER"/> 
     </intent-filter> 
    </activity> 

    <receiver 
     android:name=".broadcast.FirebaseBroadcastReceiver" 
     android:exported="true"> 
     <intent-filter> 
      <action android:name="com.rrrrr.app.sendFireBaseBroadCast"/> 

      <category android:name="com.rrrrr.app"/> 
     </intent-filter> 
    </receiver> 
    <receiver 
     android:name=".GCM.GcmBroadcastReceiver" 
     android:exported="true" 
     android:permission="com.google.android.c2dm.permission.SEND"> 
     <intent-filter> 
      <action android:name="com.google.android.c2dm.intent.RECEIVE"/> 

      <category android:name="com.motary.app"/> 
     </intent-filter> 
    </receiver> 

    <service 
     android:name=".GCM.GcmIntentService" 
     android:exported="false"> 
     <intent-filter> 
      <action android:name="com.google.android.c2dm.intent.RECEIVE"/> 
      <action android:name="com.google.android.c2dm.intent.REGISTRATION"/> 
     </intent-filter> 
    </service> 

    <activity 
     android:name=".activity.BaseActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <activity 
     android:name=".activity.CropActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait"/> 
    <activity 
     android:name=".activity.Signup" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <activity 
     android:name=".activity.PlateRequestSubmissionActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <activity 
     android:name=".activity.Signin" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <activity 
     android:name=".activity.ForgotPasswordActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <activity 
     android:name=".activity.ProfileActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <activity 
     android:name=".activity.ResetPasswordActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 

    <meta-data 
     android:name="io.fabric.ApiKey" 
     android:value="hidden"/> 
    <meta-data 
     android:name="com.google.android.geo.API_KEY" 
     android:value="hidden"/> 

    <activity 
     android:name=".activity.RequestSubmissionActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:label="@string/title_activity_request_submission" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <activity 
     android:name=".activity.CarDetailsActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme" 
     android:windowSoftInputMode="adjustNothing"> 
     <intent-filter> 
      <action android:name="android.intent.action.SEND_MULTIPLE"/> 

      <category android:name="android.intent.category.DEFAULT"/> 

      <data android:mimeType="image/*"/> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".activity.ChatActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <activity 
     android:name=".activity.LicensePlateDetailsActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <activity 
     android:name=".activity.PostLicensePlateActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <activity 
     android:name=".activity.PaymentActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
     android:screenOrientation="portrait" 
     android:theme="@style/MyMaterialTheme"/> 
    <!-- 
      <service 
       android:name="com.paypal.android.sdk.payments.PayPalService" 
       android:exported="false"/> 

      <activity 
       android:name="com.paypal.android.sdk.payments.PaymentActivity" 
       android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
       android:screenOrientation="portrait" 
       android:theme="@style/MyMaterialTheme"/> 
      <activity 
       android:name="com.paypal.android.sdk.payments.LoginActivity" 
       android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
       android:screenOrientation="portrait" 
       android:theme="@style/MyMaterialTheme"/> 
      <activity 
       android:name="com.paypal.android.sdk.payments.PaymentMethodActivity" 
       android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
       android:screenOrientation="portrait" 
       android:theme="@style/MyMaterialTheme"/> 
      <activity 
       android:name="com.paypal.android.sdk.payments.PaymentConfirmActivity" 
       android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
       android:screenOrientation="portrait" 
       android:theme="@style/MyMaterialTheme"/> 
      <activity 
       android:name="com.paypal.android.sdk.payments.PayPalFuturePaymentActivity" 
       android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
       android:screenOrientation="portrait" 
       android:theme="@style/MyMaterialTheme"/> 
      <activity 
       android:name="com.paypal.android.sdk.payments.FuturePaymentConsentActivity" 
       android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
       android:screenOrientation="portrait" 
       android:theme="@style/MyMaterialTheme"/> 
      <activity 
       android:name="com.paypal.android.sdk.payments.FuturePaymentInfoActivity" 
       android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
       android:screenOrientation="portrait" 
       android:theme="@style/MyMaterialTheme"/> 
      <activity 
       android:name="io.card.payment.DataEntryActivity" 
       android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation|locale" 
       android:screenOrientation="portrait" 
       android:theme="@style/MyMaterialTheme"/>--> 
    <activity android:name=".luminous.pick.CustomGalleryActivity"> 
     <intent-filter> 
      <action android:name="luminous.ACTION_PICK"/> 
      <action android:name="luminous.ACTION_MULTIPLE_PICK"/> 

      <category android:name="android.intent.category.DEFAULT"/> 
     </intent-filter> 
    </activity> 
    <activity 
     android:name=".activity.NotificationActivity" 
     android:theme="@style/Theme.CustomTranslucent"> 

    </activity> 
</application> 

的build.gradle AAR模块。我用新的模块和.aar项目导入它

configurations.maybeCreate("default") 
artifacts.add("default", file('telrlibrary-release-1.aar')) 

形象工程层次 enter image description here 事件注销放

1:15 PM Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] 

1:15 PM Gradle build finished with 1 error(s) in 3s 483ms 

摇篮控制台

Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] 

Configuration on demand is an incubating feature. 
Incremental java compilation is an incubating feature. 
:app:preBuild UP-TO-DATE 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareComAndroidSupportAnimatedVectorDrawable2531Library 
:app:prepareComAndroidSupportAppcompatV72531Library 
:app:prepareComAndroidSupportCardviewV72340Library 
:app:prepareComAndroidSupportConstraintConstraintLayout102Library 
:app:prepareComAndroidSupportDesign2311Library 
:app:prepareComAndroidSupportMediarouterV72300Library 
:app:preDebugAndroidTestBuild UP-TO-DATE 
:app:prepareComAndroidSupportMultidex101Library 
:app:prepareComAndroidSupportRecyclerviewV72311Library 
:app:prepareComAndroidSupportSupportCompat2531Library 
:app:prepareComAndroidSupportSupportCoreUi2531Library 
:app:prepareComAndroidSupportSupportCoreUtils2531Library 
:app:prepareComAndroidSupportSupportFragment2531Library 
:app:prepareComAndroidSupportSupportMediaCompat2531Library 
:app:prepareComAndroidSupportSupportV42531Library 
:app:prepareComAndroidSupportSupportVectorDrawable2531Library 
:app:prepareComCrashlyticsSdkAndroidAnswers138Library 
:app:prepareComCrashlyticsSdkAndroidBeta116Library 
:app:prepareComCrashlyticsSdkAndroidCrashlytics257Library 
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore2310Library 
:app:prepareComFacebookAndroidFacebookAndroidSdk490Library 
:app:prepareComGoogleAndroidGmsPlayServices840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library 
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library 
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library 
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library 
:app:prepareComGoogleAndroidGmsPlayServicesCast840Library 
:app:prepareComGoogleAndroidGmsPlayServicesDrive840Library 
:app:prepareComGoogleAndroidGmsPlayServicesFitness840Library 
:app:prepareComGoogleAndroidGmsPlayServicesGames840Library 
:app:prepareComGoogleAndroidGmsPlayServicesGcm840Library 
:app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library 
:app:prepareComGoogleAndroidGmsPlayServicesLocation840Library 
:app:prepareComGoogleAndroidGmsPlayServicesMaps840Library 
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library 
:app:prepareComGoogleAndroidGmsPlayServicesNearby840Library 
:app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library 
:app:prepareComGoogleAndroidGmsPlayServicesPlus840Library 
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library 
:app:prepareComGoogleAndroidGmsPlayServicesVision840Library 
:app:prepareComGoogleAndroidGmsPlayServicesWallet840Library 
:app:prepareComGoogleAndroidGmsPlayServicesWearable840Library 
:app:prepareDarahimTelrlibraryRelease1UnspecifiedLibrary 
:app:prepareIoFabricSdkAndroidFabric1312Library 
:app:prepareNetSimonvtMenudrawerMenudrawer306Library 
:app:prepareDebugDependencies 
:app:compileDebugAidl UP-TO-DATE 
:app:compileDebugRenderscript UP-TO-DATE 
:app:generateDebugBuildConfig UP-TO-DATE 
:app:mergeDebugShaders UP-TO-DATE 
:app:compileDebugShaders UP-TO-DATE 
:app:generateDebugAssets UP-TO-DATE 
:app:mergeDebugAssets UP-TO-DATE 
:app:processDebugManifest 
C:\Users\mu\Desktop\myapp\app\src\main\AndroidManifest.xml:53:9-39 Error: 
    Attribute [email protected] value=(@mipmap/appicon) from AndroidManifest.xml:53:9-39 
    is also present at [myapp:telrlibrary-release-1:unspecified] AndroidManifest.xml:18:9-43 value=(@mipmap/ic_launcher). 
    Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:49:5-273:19 to override. 
C:\Users\mu\Desktop\myapp\app\src\main\AndroidManifest.xml:50:9-41 Error: 
    Attribute [email protected] value=(com.rrrr.app.helper.MotaryApp) from AndroidManifest.xml:50:9-41 
    is also present at [myapp:telrlibrary-release-1:unspecified] AndroidManifest.xml:16:9-59 value=(com.telr.mobile.sdk.TelrApplication). 
    Suggestion: add 'tools:replace="android:name"' to <application> element at AndroidManifest.xml:49:5-273:19 to override. 
C:\Users\mu\Desktop\myapp\app\src\main\AndroidManifest.xml:57:9-47 Error: 
    Attribute [email protected] value=(@style/MyMaterialTheme) from AndroidManifest.xml:57:9-47 
    is also present at [myapp:telrlibrary-release-1:unspecified] AndroidManifest.xml:21:9-40 value=(@style/AppTheme). 
    Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:49:5-273:19 to override. 
C:\Users\mu\Desktop\myapp\app\src\main\AndroidManifest.xml:6:5-46 Error: 
    uses-sdk:minSdkVersion 15 cannot be smaller than version 21 declared in library [myapp:telrlibrary-release-1:unspecified] C:\Users\mu\.android\build-cache\1cd525d2640e923ca7aab868b0d3fdaa85853546\output\AndroidManifest.xml 
    Suggestion: use tools:overrideLibrary="com.telr.mobile.sdk" to force usage 


See http://g.co/androidstudio/manifest-merger for more information about the manifest merger. 

:app:processDebugManifest FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':app:processDebugManifest'. 
> Manifest merger failed with multiple errors, see logs 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

BUILD FAILED 

Total time: 2.238 secs 
+0

您可以发布前夕nt日志输出? – Ivan

+0

@Ivan我加了请检查 –

+0

对不起,Gradle控制台也许在其中一个我有很多关于类似错误的信息 – Ivan

您已经声明:

appTheme:myMaterialTheme声明两次,也许在应用程序和AAR包

,并与其他一些几件事情作为ic_launcher和AP​​PICON

相同的内径

观看建议它给:

add 'tools:replace="android:name"' to <application> element 
+0

我该如何解决它作为telrlibrary-release-1是TELR库 –

+0

它是否适合你? @RizwanAhmed – Ivan

+0

它为我工作的工具:替换=“android:名称,android:主题,android:图标” –

添加此行装箱这个模块在你的应用级别gradle中: -

android { 
    defaultConfig { 
     multiDexEnabled true 
    } 
} 

,并添加这在你的应用水平gradle这个文件的依赖性: -

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

在标签部分在的AndroidManifest.xml加入这一行。

<application 
     android:name="android.support.multidex.MultiDexApplication" 
     tools:replace="android:name"> 
</application> 
+0

请接受答案,如果它以任何方式帮助你 –