Start a new topic
Solved

Cannot build examples

Cannot build examples


I have some problems to start with the wikitude sdk. I tried to import the android native examples into android studio. When I try to start the application there are 2 errors and I do not know how to fix it. In addition the symbol 'R' cannot reslove, maybe this in context with the errors.

Thanks for your help!

 

Error:com.android.builder.internal.aapt.AaptException: Failed to crunch file E:Development\Java\libs\WikitudeSDK_NativeAPI_Android_1-4-0_2016-09-13_14-57-05\Examples\NativeSDKExamples\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\24.0.0\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into E:\Development\Java\libs\WikitudeSDK_NativeAPI_Android_1-4-0_2016-09-13_14-57-05\Examples\NativeSDKExamples\app\build\intermediates\res\merged\debug\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png
 

Error:Execution failed for task ':app:mergeDebugResources'.
> Error: com.android.builder.internal.aapt.AaptException: Failed to crunch file E:\Development\Java\libs\WikitudeSDK_NativeAPI_Android_1-4-0_2016-09-13_14-57-05\Examples\NativeSDKExamples\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\24.0.0\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into E:\Development\Java\libs\WikitudeSDK_NativeAPI_Android_1-4-0_2016-09-13_14-57-05\Examples\NativeSDKExamples\app\build\intermediates\res\merged\debug\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png

Hi,


Don't know if anyone has crossed with this problem before and still haven't found its solution.


I had the same problem in a Windows 10 environment and what solved it (in my case) was changing the project folder location.


I had extracted the NativeExamples in an inner folder very deep inside my "dev" folder. 

Something like this:
"C:\Dev\Android\projs\WikitudeSDK_NativeAPI_Android_1-4-1_2016-11-23_17-04-21\Examples\NativeSDKExamples"


Opened up the project in Android Studio and that error appeared.


Later on, I changed the project path to a higher level in the path hierarchy (C:\Dev\Android\projs\NativeSDKExamples) and it worked.


I hope this help anyone facing this kind of error.

Regards,
José Cunha

Hi David,

I'm afraid I don't have a definitive answer for you regarding this issue. However, I'd like you to execute the following commands in Android Studio and report back to me whether your issues persist.
Tools > Android > Sync Project with Gradle Files
File > Invalidate Caches / Restart
 
Kind regards
Daniel
Hi Daniel,

thanks for your reply, but it doesnt work. In the code there are also some errors, because it cannot resolve symbol R. I dont know if these errors are in context with the errors in the messages grade build.

This is my build.gradle

 

Module: app
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.wikitude.nativesdksampleapp"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

dependencies {
compile(name: 'wikitude-native-sdk', ext: 'aar')
compile fileTree(dir: 'libs', include: )
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
}

repositories {
flatDir {
dirs 'libs'
}
}


 

 

Project: NativeSDKExamples

// 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:2.2.0'

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

allprojects {
repositories {
jcenter()
}
}

 

Hi David,

Would you mind uploading your project somewhere and providing me with a download link to it? I think I could be of more use regarding this issue if I could reproduce it on my system and investigate it directly.

Kind regards
Daniel

Hi Daniel, thanks for your help.

I download the following project: WikitudeSDK_NativeAPI_Android_1-4-0_2016-09-13_14-57-05

and opened the NativeSDKExamples as an Android Studio project and I changed nothing. I can upload the example project, but I do not know if this is helpfull.

I am using Android 2.2.1.

https://www.dropbox.com/s/2d9ez3xexcwyk6j/NativeSDKExamples.rar?dl=0

Maybe we want to buy Wikitudes SDK for our project, but I cannot run the examples to have a quick overview about the functions and how it works :(
Login or Signup to post a comment