android - 在 android studio 项目中集成 DroidAR 时 Gradle 构建错误

标签 android android-studio augmented-reality

我们提供了将 DroidAR 集成到 Eclipse 项目中的指南,此链接提供:DroidAR Mobile Augmented Reality - How to use the framework in your own application但我正在努力在 AndroidStudio 项目中设置 DroidAR。

我遵循的步骤是:

  1. 已从此链接下载 DroidAR - DroidAR
  2. 创建了一个新的 android studio 项目 - DroidArSample
  3. 导入 droidar 文件夹(在下载的存档中找到,第 2 步)作为 DroidArSample 中的新模块
  4. 将 droidar 添加为 DroidArSample 的依赖项
  5. 从 droidar/AndroidManifest.xml 中删除了图标相关属性
  6. 编译

它显示了 120 个编译错误,下面指定了一些错误:

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 消息是:

 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 文件是否存在以下版本不匹配:

  1. compileSdkVersion
  2. buildToolsVersion
  3. targetSdkVersion
  4. 包括应用兼容库,例如编译 'com.android.support:appcompat-v7:23.0.0'

建议将它们全部设置为相同的版本,以避免出现问题中提到的问题

例如如果您使用 API Level-23,您在 build.gradle 中的配置应该如下所示:

(在相应的地方声明了以下各项)

compileSdkVersion 23

buildToolsVersion "23.0.0"

targetSdkVersion 23

compile 'com.android.support:appcompat-v7:23.0.0'

Refererence

关于android - 在 android studio 项目中集成 DroidAR 时 Gradle 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34636863/

相关文章:

android - 无法解析 ':app@debug/compileClasspath' : Could not resolve com. google.android.gms :play-services-basement:[15. 0.0,16.0.0 的依赖关系)

android - 过滤 ArrayList 和为 RecyclerView 设置适配器时滞后

ios - 从增强现实开始

android - 使用 GSON 调整 Retrofit 响应

android - 使用 Webview 的 Paypal

java - 我如何知道我的应用程序中两次操作之间经过了多少时间?

android - 如何在 Koush ion 中构建 URL

unity-game-engine - 如何在 Hololens 模拟器中测试 Air Tap 手势?

从图像创建 AR 标记

java - "Unfortunately (app name) hast stopped"的字体原因