zoukankan      html  css  js  c++  java
  • Default interface methods are only supported starting with Android N (--min-api 24): void androidx.lifecycle.DefaultLifecycleObserver.onCreate(androidx.lifecycle.LifecycleOwner)

    android {
        compileSdkVersion 29
        buildToolsVersion "29.0.3"
    
        defaultConfig {
            applicationId "com.abc"
            minSdkVersion 21
            targetSdkVersion 29
            versionCode 1
            versionName "1.1.1"
    
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    
            ndk {
                abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
            }
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
    
        /**
         * 解决问题:
         * Default interface methods are only supported starting with Android N (--min-api 24): void androidx.lifecycle.DefaultLifecycleObserver.onCreate(androidx.lifecycle.LifecycleOwner)
         * **/
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    
    }

    添加标红内容即可

  • 相关阅读:
    MUI-页面传参数
    Spring-boot:多模块打包
    PythonDay11
    PythonDay10
    PythonDay09
    PythonDay08
    PythonDay07
    PythonDay06
    PythonDay05
    PythonDay04
  • 原文地址:https://www.cnblogs.com/ice5/p/14417572.html
Copyright © 2011-2022 走看看