我尝试将com.android.model.application
转换为com.android.application
我该怎么做?问题出在CFlags.add
。
这是我的傻瓜:
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion 27
buildToolsVersion = '27.0.0'
defaultConfig.with {
applicationId "com.update.myapp"
minSdkVersion.apiLevel = 19
targetSdkVersion.apiLevel = 26
versionCode 1
versionName "1.0.2"
multiDexEnabled true
}
}
android.buildTypes {
release {
minifyEnabled false
proguardFiles.add(file('proguard-android.txt'))
}
}
android.ndk {
moduleName = "Test_Jni"
CFlags.add("-DCOMPANION_DEVICE")
CFlags.add("-DDISABLE_LOGS")
CFlags.addAll(["-I${file("src/main/jni/Folder1/")}".toString(),
"-I${file("src/main/jni/Folder2")}".toString(),
"-I${file("C:\\Program Files (x86)\\MyFile\\folder1_Cfiles/")}".toString(),
"-I${file("C:\\Program Files (x86)\\MyFile\\folder2_Cfiles/")}".toString()])
ldLibs.addAll(["log"])
}
android.sources {
main {
jni {
source {
srcDirs "src/main/jni"
srcDirs "C:\\Program Files (x86)\\MyFile\\folder1_Cfiles"
srcDirs "C:\\Program Files (x86)\\MyFile\\folder2_Cfiles"
}
}
}
}dependencies{ compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:27.0.2'}