【发布时间】:2020-11-11 07:12:04
【问题描述】:
我需要编译一个项目,但我需要解决任何错误。我的 Android Grandle Plugin 版本是 3.1.1,Grandle 版本是 4.4
Build file '/home/javier/Descargas/VisitaOficialArriboOfflinev2/VisitaOficialArriboOffline/app/build.gradle' line: 79A problem occurred evaluating project ':app'.> Could not find method ndkversion() forarguments [21.3.6528147] on object of type com.android.build.gradle.AppExtension.
这是我的 build:gardle:app 有错误的行是 ndkversion '21.3.6528147'
//apply plugin: 'com.android.feature' for instant app
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 23
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk{
abiFilters "x86", "armeabi-v7a", "armeabi-v8a", "x86_64"
}
externalNativeBuild {
cmake {
cppFlags ""
}
}
}
buildTypes {
release {
//Remove minifyEnabled true from release if you are getting error while creating final releasing api.
minifyEnabled false
debuggable false
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
//Remove minifyEnabled true from debug if you are getting error while compiling the app. As this time its running debug part.
minifyEnabled false
debuggable true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path file ('CMakeLists.txt')
}
}
// Configure only for each module that uses Java 8
// language features (either in its source code or
// through dependencies).
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
splits {
//....
}
//The line with error
ndkversion '21.3.6528147' }
我的ndk的path路由是“ndk.dir=/home/javier/Android/Sdk/ndk” 感谢您的帮助
【问题讨论】:
-
不应该是
ndkVersion加上大写的V吗? -
不,是同样的错误,但现在使用 ndkVersion()
标签: android android-studio android-ndk build.gradle ndk-build