From several months I’m encountering difficulties to build Android APKs.
I’m working with Windows 10 with last version of Felgo and Android SDK and NDK installed as said in Felgo docs.
Android build is failing with the default settings but if I’m changing versions of android.support it works !
1st, here is my build.gradle file which is the one by default for an empty app project template:
———————————————————————————————————————
<div>buildscript {
repositories {
jcenter()
}</div>
<div> dependencies {
classpath ‘com.android.tools.build:gradle:2.3.3’
}
}</div>
<div>allprojects {
repositories {
maven { url ‘https://maven.google.com’ }
jcenter()
maven { url ‘https://sdk.felgo.com/maven/’ }
}
}</div>
<div>apply plugin: ‘com.android.application'</div>
<div>dependencies {
compile fileTree(dir: ‘libs’, include: [‘*.jar’])</div>
<div> compile “com.android.support:support-core-utils:27.1.0”
compile “com.android.support:appcompat-v7:27.1.0″</div>
<div> compile ‘net.vplay.plugins:plugin-onesignal:2.+’
}</div>
<div>android {
/*******************************************************
* The following variables:
* – androidBuildToolsVersion,
* – androidCompileSdkVersion
* – qt5AndroidDir – holds the path to qt android files
* needed to build any Qt application
* on Android.
*
* are defined in gradle.properties file. This file is
* updated by QtCreator and androiddeployqt tools.
* Changing them manually might break the compilation!
*******************************************************/</div>
<div> compileSdkVersion androidCompileSdkVersion.toInteger()
buildToolsVersion androidBuildToolsVersion</div>
<div> defaultConfig.applicationId = ‘com.yourcompany.wizardEVAP.BuildAPKTest01′</div>
<div> sourceSets {
main {
manifest.srcFile ‘AndroidManifest.xml’
java.srcDirs = [qt5AndroidDir + ‘/src’, ‘src’, ‘java’]
aidl.srcDirs = [qt5AndroidDir + ‘/src’, ‘src’, ‘aidl’]
res.srcDirs = [qt5AndroidDir + ‘/res’, ‘res’]
resources.srcDirs = [‘src’]
renderscript.srcDirs = [‘src’]
assets.srcDirs = [‘assets’]
jniLibs.srcDirs = [‘libs’]
}
}</div>
<div> lintOptions {
abortOnError false
}
}</div>
<div>———————————————————————————————————————</div>
So this one goes to a build which failed with this error msg:
…
<div>:processDebugResources FAILED</div>
<div>FAILURE: Build failed with an exception.</div>
<div>* What went wrong:
Execution failed for task ‘:processDebugResources’.
> com.android.ide.common.process.ProcessException: Failed to execute aapt</div>
<div>* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.</div>
<div>BUILD FAILED</div>
…
So… to make the Android build working well I’ve managed to change these 2 lines in my gradle file:
compile “com.android.support:support-core-utils:25.1.0”
compile “com.android.support:appcompat-v7:25.1.0”
And it works but only if I comment or remove this line:
compile ‘net.vplay.plugins:plugin-onesignal:2.+’
But I need OneSignal!!!
So I hope my explanations will help you to give me a solution, because I must admit that I’m not very familiar with the sdk Android to find a solution myself
Thank you
Jean-Marc