gpt4 book ai didi

android - Gradle DSL 找不到源()

转载 作者:行者123 更新时间:2023-12-03 05:13:29 28 4
gpt4 key购买 nike

我对 AR 很陌生,我使用的是 Android Studio 2.1.2,我尝试运行 ARToolKit 提供的示例。

the error says: Gradle DSL method not found: 'sources()'



我正在使用 Gradle 2.13,下面是代码
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig.with {
applicationId "org.artoolkit.ar.samples.ARSimple"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
//Integer type incremented by 1 for every release, major or minor, to Google store
versionName "1.0" //Real fully qualified major and minor release description

//buildConfigFields.with {
//Defines fields in the generated Java BuildConfig class, in this case, for
// create() { //default config, that can be accessed by Java code
// type "int" //e.g. "if (1 == BuildConfig.VALUE) { /*do something*/}".
// name "VALUE"
//See: [app or lib]/build/generated/source/buildConfig/[package path]/
// value "1" // BuildConfig.java
// }
// }
}

}

android.buildTypes {
release {
minifyEnabled false
proguardFiles file('proguard-rules.pro')
}
}

android.productFlavors {
}



android.sources {
main.jni {
source {
srcDirs "src/main/nop"
}
}
main.jniLibs {
source {
srcDirs "src/main/libs"
}
}
}

dependencies {
//compile 'com.android.support:support-v4:23.0.1'
//compile 'com.android.support:appcompat-v7:23.0.1' //Only required when the target device API level is greater than
compile project(':aRBaseLib')
} //the compile and target of the app being deployed to the device

android {
buildToolsVersion '23.0.3'
}

最佳答案

您是否按照这些说明使用 ARToolKit 和原生开发设置环境?

http://artoolkit.org/documentation/doku.php?id=4_Android:android_native

请遵循这些说明,因为它们会指导您设置系统,即使您的目标不是开发 native 。

除此之外,由于您的描述包含的信息较少,因此我无能为力。

ARToolKit 示例附带一个预配置的 gradle.wrapper,其中包含正确的版本,并且示例通常是开箱即用的。

gradle.wrapper

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(来自 ARSimpleProj)
buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle-experimental:0.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
}

关于android - Gradle DSL 找不到源(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38702437/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com