在android studio项目中集成DroidAR时出现Gradle构建错误
我们在这个链接中提供了在Eclipse项目中集成DroidAR的指导原则:但是我正在一个AndroidStudio项目中设置DroidAR 我遵循的步骤是:在android studio项目中集成DroidAR时出现Gradle构建错误,android,android-studio,augmented-reality,Android,Android Studio,Augmented Reality,我们在这个链接中提供了在Eclipse项目中集成DroidAR的指导原则:但是我正在一个AndroidStudio项目中设置DroidAR 我遵循的步骤是: 从该链接下载DroidAR- 创建了一个新的android studio项目-DroidArSample 导入的droidar文件夹(在下载的归档文件中找到,步骤2)作为DroidArSample中的新模块 将droidar作为依赖项添加到DroidArSample 已从droidar/AndroidManifest.xml中删除与图标相关
AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027android:Widget.Material.Spinner.Underlined\u0027.","sources":[{"file":"/Users/devarshi.k/Downloads/DroidArSample/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/res/values-ldltr-v21/values-ldltr-v21.xml","position":{"startLine":1}}],"original":""}
AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027android:Widget.Material.Spinner.Underlined\u0027.","sources":[{"file":"/Users/devarshi.k/Downloads/DroidArSample/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/res/values-ldrtl-v23/values-ldrtl-v23.xml","position":{"startLine":1}}],"original":""}
AGPBI: {"kind":"error","text":"No resource found that matches the given name: attr \u0027android:textAlignment\u0027.","sources":[{"file":"/Users/devarshi.k/Downloads/DroidArSample/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/res/values-v17/values-v17.xml","position":{"startLine":5,"startColumn":20,"startOffset":407,"endColumn":41,"endOffset":428}}],"original":""}
最后一条失败消息是:
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/devarshi.k/Library/Android/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
有什么想法吗?将下一行添加到您的
build.gradle
android {
...
compileOptions.encoding = 'ISO-8859-1' // write your encoding here
...
}
检查您的
build.gradle
文件是否存在以下版本之间的不匹配:
compileSdkVersion
buildToolsVersion
targetSdkVersion
build.gradle
中的配置应如下所示:
(在各自的地方声明以下各项)
我从GitHub下载了您的项目,并用以下方式编辑了build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
...
defaultConfig {
applicationId "daemonconstruction.droidarsample"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
dependencies {
...
compile 'com.android.support:appcompat-v7:22.+'
...
}
}
同步,重建项目,然后它就可以工作了。你可以发布你的构建。gradle吗?这里是gradle的链接:,这里是它的代码库链接:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
...
defaultConfig {
applicationId "daemonconstruction.droidarsample"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
dependencies {
...
compile 'com.android.support:appcompat-v7:22.+'
...
}