-1
我使用的是Android工作室,當我刷新所有gradle這個項目在控制檯我:的Java的Android無法找到一個方法NDK()
Error:(28, 0) Could not find method ndk() for arguments [[email protected]]
on object of type com.android.build.gradle.AppExtension.
<a href="openFile:C:\Users\ElteGps 022\Desktop\PairingCodes\app\build.gradle">Open File</a>
而在消息我看到:
可能找不到參數
方法NDK()這是我的build.gradle
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "smok.pl.pairingcodes"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
ndk {
moduleName "liblfrfid"
abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
}
task nativeLibsToJar(type: Jar, description: 'create a jar archive of the native libs') {
destinationDir file("$buildDir/native-libs")
baseName 'native-libs'
from fileTree(dir: 'libs', include: '**/*.so')
into 'lib/'
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
}
}
repositories {
maven { url "http://dl.bintray.com/bednarthe/maven" }
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/core-2.2.jar')
compile files('libs/jsr305-3.0.0.jar')
compile files('libs/ksoap2-android-assembly-3.6.2-jar-with-dependencies.jar')
compile files('libs/picasso-2.3.4.jar')
compile('com.crashlytics.sdk.android:crashlytics:[email protected]')
}
能夠解決您的問題?看到更新的答案。 –