我无法同步Android项目我在下面添加了gradle代码。当我同步它失败并添加消息时:错误:无法在null对象上调用方法add() apply plugin:' com.android.application'。我尝试了一切,但无法修复它
android {
def ci_pf = new File('ci.properties')
if (ci_pf.canRead()) {
def Properties ci_p = new Properties()
ci_p.load(new FileInputStream(ci_pf))
def bld = ci_p['ci_versionCode'].toInteger()
def bvn = ci_p['ci_versionName']
def csv = ci_p['ci_compileSdkVersion'].toInteger()
def btv = ci_p['ci_buildToolsVersion']
def msv = ci_p['ci_minSdkVersion'].toInteger()
def tsv = ci_p['ci_targetSdkVersion'].toInteger()
def cxf = ci_p['ci_cppFlags']
compileSdkVersion csv
buildToolsVersion btv
defaultConfig {
applicationId "com.nordcurrent.AdSystemTest"
minSdkVersion msv
targetSdkVersion tsv
versionCode bld
versionName bvn
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11 -frtti -fexceptions -Wno-nonportable-include-path -DDEBUG -D_DEBUG " + cxf
cFlags "-D\"lua_getlocaledecpoint()='.'\" -DLUA_ANSI -DUSE_ANDROID"
arguments "-DANDROID_STL=c++_static", "-DANDROID_ARM_MODE=arm", "-DANDROID_ARM_NEON=TRUE"
}
}
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
abiFilters 'armeabi-v7a', 'x86'
jobs 32
}
}
compileSdkVersion = csv
buildToolsVersion = btv
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled = false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
}
}
}
android.productFlavors {
create("fat") {
ndk.abiFilters.add("armeabi-v7a")
ndk.abiFilters.add("x86")
}
}
android.sources {
main {
jni {
source {
srcDirs 'src/main/jni'
}
}
}
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name: 'Millennial', ext: 'aar')
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.google.android.gms:play-services-ads:10.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:support-annotations:25.2.0'
/** Tune dependency */
compile 'com.android.support:support-v4:23.1.1'
compile 'de.greenrobot:eventbus:2.4.0'
androidTestCompile 'com.android.support:support-annotations:25.2.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
testCompile 'junit:junit:4.12'
compile 'junit:junit:4.12'
}