Forums

OverviewFelgo 2 Support (Qt 5) › Android build failed, maybe because of gradle or version of something…

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #20514

    Jean-Marc

    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

    #20520

    Günther
    Felgo Team

    Hi Jean-Marc,

    So this happens for every empty project as soon as the ‘net.vplay.plugins:plugin-onesignal:2.+’ OneSignal library dependency is added?

    Which Android SDK and NDK version are using at the moment? We’ll have closer look to see if we can reproduce the issue!

    Best,
    Günther

    #20521

    Jean-Marc

    Hi, thank you for your answer.

    It happens (failed for Android build) for every empty project EVEN if OneSignal is not added.

    But if I’m changing these 2 lines:

    compile “com.android.support:support-core-utils:27.1.0”
    compile “com.android.support:appcompat-v7:27.1.0”
    to:
    compile “com.android.support:support-core-utils:25.1.0”
    compile “com.android.support:appcompat-v7:25.1.0”

    then I can build for Android and everything’s working well…
    BUT, with this modification, if then I add the ‘net.vplay.plugins:plugin-onesignal:2.+’ OneSignal library, then the Android build failed again!

    Here are my SDK and NDK versions (copied for QtCreator options):
    Android settings are OK. (SDK Version: 25.2.5, NDK Version: 14.0.3770861)

    Best,
    Jean-Marc

    #20524

    Jean-Marc

    Hi Günther,

    Do you have any clue or idea about what is going wrong ?

    Best,

    Jean-Marc

    #20525

    Günther
    Felgo Team

    Hi Jean-Marc,
    ​We did some tests based on your SDK / NDK version setup. When using Android SDK version 25, we can reproduce the issue you mentioned.

    ​The OneSignal plugin requires the appcompat and utils library of version 27, which are not compatible with Android SDK 25.
    ​So to be able to build for Android with One Signal annd these library versions, please update your Android SDK to e.g. version 26.
    ​You should be able to build for Android without issues then.

    ​Let me know if this solves the issue for you!

    Note: You after installing the new Android SDK, you can choose the used SDK version in the Project Configuration (left Qt Creator Tab). The Android build SDK option is available in the “Build Android APK” section of the project settings for Android. Please also make sure to create a fresh and clean build after updating the environment.


    ​Best,
    ​Günther from Felgo

    #20529

    Jean-Marc
Viewing 6 posts - 1 through 6 (of 6 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support