나는 다음으로 NDK 안드로이드 스튜디오를 구성하기 위해 노력 해왔다 이 기사와 이 기사를. 다음은 내 gradle-wrapper.properties의 내용입니다.
#Sat Aug 08 09:36:53 IST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-all.zip
다음은 build.gradle (project)의 내용입니다.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle-experimental:0.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
마지막으로 build.gradle (module)
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion = 22
buildToolsVersion = "23.0.0 rc3"
defaultConfig.with {
applicationId = "com.opaxlabs.nativetest"
minSdkVersion.apiLevel = 15
targetSdkVersion.apiLevel = 22
versionCode = 1
versionName = "1.0"
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles += file('proguard-rules.pro')
}
}
}
android.ndk{
moduleName = "native"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
gradle 파일을 동기화하려고하면 다음 오류가 발생합니다.
Error:No such property: android for class: com.android.build.gradle.managed.AndroidConfig
다음 경로는 local.properties에 정의되어 있습니다.
ndk.dir=/opt/adt-bundle-linux-x86_64-20140702/sdk/ndk-bundle
sdk.dir=/opt/adt-bundle-linux-x86_64-20140702/sdk
그래서 내가 뭔가를 놓친 것 같아서 찾을 수 없습니다. 어떤 도움이라도 대단히 감사하겠습니다.
build.gradle (module)에서 android.buildTypes 블록은 android 블록 외부에 있어야합니다 . 따라서 다음과 같이 보일 것입니다.
model {
android {
compileSdkVersion = 22
buildToolsVersion = "23.0.0 rc3"
defaultConfig.with {
applicationId = "com.opaxlabs.nativetest"
minSdkVersion.apiLevel = 15
targetSdkVersion.apiLevel = 22
versionCode = 1
versionName = "1.0"
}
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles += file('proguard-rules.pro')
}
}
android.ndk{
moduleName = "native"
}
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다