Android 运行报错整理


1:运行报错Error: Static interface methods are only supported starting with Android N (--min-api 24)
通过在app的build.gradle文件中配置使用java8编译:

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

2.遇到引入supper冲突

过在app的build.gradle文件中的dependencies中配置(一劳永逸)
configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '28.0.0'
            }
        }
    }
}

3.华为推送 & Failed to resolve: com.huawei.android.hms:push:2.5.3.302加入maven 依赖

maven { url 'http://developer.huawei.com/repo' }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章