首页 文章

我发现运行时错误无法实例化应用程序android.support.multidex.MultiDexApplication

提问于
浏览
0

这是我的错误

E / AndroidRuntime:FATAL EXCEPTION:main进程:in.tvac.akshayejh.photoblog,PID:5053 java.lang.RuntimeException:无法实例化应用程序android.support.multidex.MultiDexApplication:java.lang.ClassNotFoundException:未找到路径上的类“android.support.multidex.MultiDexApplication”:DexPathList [[zip file“/data/app/in.tvac.akshayejh.photoblog-1/base.apk

这是我的清单文件

<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application

    android:allowBackup="true"
    android:name="android.support.multidex.MultiDexApplication"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity

        android:name=".MainActivity"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".LoginActivity"
        android:screenOrientation="portrait" />
    <activity android:name=".RegisterActivity" />
    <activity android:name=".SetupActivity" />
    <activity
        android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
        android:theme="@style/Base.Theme.AppCompat" />
    <activity
        android:name=".NewPostActivity"
        android:parentActivityName=".MainActivity" />
    <activity android:name=".CommentsActivity"
        android:parentActivityName=".MainActivity"></activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />

这是App gradle文件

apply plugin: 'com.android.application'

    android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "in.tvac.akshayejh.photoblog"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

    dependencies {
    implementation fileTree(include: ['*.jar'],dir: 'libs' )
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.google.firebase:firebase-firestore:11.8.0'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
    implementation 'com.github.bumptech.glide:glide:4.6.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
    implementation 'id.zelory:compressor:2.1.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.firebase:firebase-core:16.0.1'
}

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

这是项目gradle文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'



        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.0.2'
    }
}

    allprojects {
    repositories {
        google()
        jcenter()
    }
}

    task clean(type: Delete) {
    delete rootProject.buildDir
}

1 回答

相关问题