3

当我从 android studio 运行应用程序时出现错误。如果有人知道以下错误的解决方案,请给我解决此错误的建议。

错误:任务“:app:transformClassesWithInstantRunForDebug”执行失败。

java.lang.VerifyError(没有错误信息)

这是应用程序依赖项的代码。

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId 'com.example.app'
        minSdkVersion 17
        targetSdkVersion 26
        versionCode 12
        versionName "1.0"
//        versionCode getVersionCode()
//        versionName getVersionName()
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    lintOptions {
        // if true, stop the gradle build if errors are found
        abortOnError false
        // turn on the given issue id's
        enable 'RtlHardcoded', 'RtlCompat', 'RtlEnabled'
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    repositories {
        maven {
            url uri('mint-plugin-repo-5.1.0')
        }
    }
    productFlavors {
    }
}

repositories {
    mavenCentral() // jcenter() works as well because it pulls from Maven Central
}

def getVersionCode = { ->
    try {
        def stdout = new ByteArrayOutputStream()
        exec {
            commandLine 'git', 'rev-list', '--first-parent', '--count', 'master'
            standardOutput = stdout
        }
        return Integer.parseInt(stdout.toString().trim())
    }
    catch (ignored) {
        return -1;
    }
}
def getVersionName = { ->
    try {
        def stdout = new ByteArrayOutputStream()
        exec {
            commandLine 'git', 'describe', '--tags'
            standardOutput = stdout
        }
        return stdout.toString().trim()
    }
    catch (ignored) {
        return null;
    }
}

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '26.0.0'
            }
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //For error logcat
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.airbnb.android:lottie:2.2.5'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.5'
    compile 'com.mikhaellopez:circularimageview:3.0.2'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.android.support:design:26.0.0'
    compile 'uk.co.chrisjenx:calligraphy:2.2.0'
    compile 'com.android.support:support-v4:26.0.0'
    //noinspection GradleCompatible
    compile 'com.google.android.gms:play-services-auth:11.6.2'
    compile 'com.google.android.gms:play-services-gcm:11.6.2'
    compile 'com.google.android.gms:play-services:11.6.2'
    compile 'com.facebook.android:facebook-android-sdk:4.12.1'
    //noinspection GradleCompatible
    compile 'com.google.firebase:firebase-messaging:11.6.2'

    compile 'com.braintreepayments:card-form:3.0.3'
    compile 'com.stripe:stripe-android:2.0.2'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:0.6.5'
    compile 'com.skyfishjy.ripplebackground:library:1.0.1'
    compile 'com.koushikdutta.ion:ion:2.+'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.splunk:mint-android-sdk:5.1.0'
    compile 'com.github.citux:datetimepicker:0.2.0'
    compile 'com.intuit.sdp:sdp-android:1.0.4'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.facebook.android:account-kit-sdk:4.+'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    testCompile 'junit:junit:4.12'
    //    compile project(':library')
    compile 'com.android.support:support-annotations:26.0.0'
}
apply plugin: 'com.google.gms.google-services'

项目依赖项的另一个代码。

// 顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
        google()
    }
}

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

0 回答 0