Android构建错误-仅从Android O(--min-api 26)开始才支持MethodHandle.invoke和MethodHandle.invokeExact

时间:2019-11-22 12:35:29

标签: java android android-studio unity3d gradle

我尝试构建从Unity3D导出的android项目。

但是,我遇到以下错误:

  

仅从Android O(--min-api 26)开始支持MethodHandle.invoke和MethodHandle.invokeExact

和下面是我的 build.gradle (我将其更改为与unity稍有不同):

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
buildscript {
    repositories {
        jcenter()
        google()
        mavenCentral()
        maven {
            url "https://jitpack.io"
        }
    }

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

allprojects {
    repositories {
        google()  
        jcenter()
        maven {
            url "https://jitpack.io"
        }
        flatDir {
            dirs 'libs'
        }
    }
}

apply plugin: 'com.android.application'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    implementation(name: 'com.google.android.gms.play-services-drive-11.0.4', ext:'aar')
    implementation(name: 'com.google.android.gms.play-services-games-11.0.4', ext:'aar')
    implementation(name: 'com.google.android.gms.play-services-gcm-12.0.1', ext:'aar')
    implementation(name: 'com.google.android.gms.play-services-iid-11.0.4', ext:'aar')
    implementation(name: 'com.google.android.gms.play-services-nearby-11.0.4', ext:'aar')
    implementation(name: 'com.google.android.gms.play-services-tasks-11.0.4', ext:'aar')
    implementation(name: 'common', ext:'aar')
    implementation(name: 'facebook-android-wrapper-7.12.0', ext:'aar')
    implementation(name: 'facebook-applinks', ext:'aar')
    implementation(name: 'facebook-common', ext:'aar')
    implementation(name: 'facebook-core', ext:'aar')
    implementation(name: 'facebook-login', ext:'aar')
    implementation(name: 'facebook-messenger', ext:'aar')
    implementation(name: 'facebook-places', ext:'aar')
    implementation(name: 'facebook-share', ext:'aar')
    implementation(name: 'GoogleAIDL', ext:'aar')
    implementation(name: 'GooglePlay', ext:'aar')
    implementation project(':common_lib')
    implementation project(':GoogleMobileAdsPlugin')
    implementation project(':youtube_lib')
    implementation "com.android.support:appcompat-v7:21.0.+"
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'org.codehaus.groovy:groovy-all:2.4.12'

}

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    compileSdkVersion 29
    buildToolsVersion '29.0.2'

    task removeBuildConfig(dependsOn: "compileReleaseSources") {
        doFirst {
            file("$buildDir/intermediates/classes/release/pathToFile/BuildConfig.class").delete()
        }
    }

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 29
        applicationId 'com.rainexplorer.belajarabc'
        multiDexEnabled true
        versionCode 209
        versionName "1.2.9"
        ndk.abiFilters 'armeabi-v7a','arm64-v8a'

    }

    lintOptions {
        abortOnError false
    }

    aaptOptions {
        noCompress '.unity3d', '.ress', '.resource', '.obb'
    }

    signingConfigs { release {
        storeFile file('C:/Users/zukinaru/drb/KEY/rainexplorer.keystore')
        storePassword 'abcxyz'
        keyAlias 'rainexplorer development team'
        keyPassword 'abcxyz'
    } }

    buildTypes {
        debug {
            minifyEnabled false
            useProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt','proguard-user.txt'
            jniDebuggable true
        }
        release {
            minifyEnabled false
            useProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt','proguard-user.txt'
            signingConfig signingConfigs.release
        }
    }

}

有解决此错误的主意吗?

谢谢

0 个答案:

没有答案