欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Error: Invoke-customs are only supported starting with Android O (--min-api 26)

程序员文章站 2022-06-17 22:38:07
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }加上如上配置:apply plugin: 'com.android.application'android { compileSdkVersion 29 buildToolsVersion '29.0.2' .....

compileOptions {

        sourceCompatibility JavaVersion.VERSION_1_8

        targetCompatibility JavaVersion.VERSION_1_8

    }


加上如上配置:


apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion '29.0.2'

    defaultConfig {
        applicationId "com.example.myijkplayerdemo"
        minSdkVersion 24
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    packagingOptions {
        pickFirst 'lib/arm64-v8a/libsqlite.so'
        pickFirst 'lib/armeabi-v7a/libsqlite.so'
        pickFirst 'lib/armeabi/libsqlite.so'
        pickFirst 'lib/x86/libsqlite.so'
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }


    compileOptions {

        sourceCompatibility JavaVersion.VERSION_1_8

        targetCompatibility JavaVersion.VERSION_1_8

    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.shuyu:GSYVideoPlayer:7.1.5'
}

 

本文地址:https://blog.csdn.net/jian11058/article/details/107928433