Egert Native Android AndroidStudio 报错整理

Egert发布Android 原生的时候报错, 我的 AndroidStudio 最新版的 3.3 ADT 28.0.3

首先呢报的是这个错

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app

替换成 api 就可以了

 然后有报错

我们统一我们的  adt 28.0.3版本

又来一个这个

 加上 google()

然后才编译 通过 安装成功

总结 分别 修改了这个两个文件

第一个 关于工程的

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
        flatDir {
            dirs 'libs'
        }
    }
}

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

第二个 关于 应用的

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "org.egret.android_template"
        minSdkVersion 14
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters 'armeabi-v7a'
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            assets.srcDirs = ['../assets']
            jniLibs.srcDirs = ['libs']
        }
    }
    buildToolsVersion '28.0.3'
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}

dependencies {
    api(name: 'egret', ext: 'aar')
}

猜你喜欢

转载自blog.csdn.net/nicepainkiller/article/details/87258609