Hi Everyone,
I’m trying to run a old V-Play Project with Felgo 3 on Android.
The Window-Build works and runs without problems but I can’t get the Android build to run.
When starting the app the following exception is thrown and I have no idea how to solve this.
Invalid ID 0x00000000.
07-18 07:09:07.255 5451 5451 E Qt : Can't create main activity
07-18 07:09:07.255 5451 5451 E Qt : android.content.res.Resources$NotFoundException: String array resource ID #0x0
07-18 07:09:07.255 5451 5451 E Qt : at android.content.res.Resources.getStringArray(Resources.java:585)
07-18 07:09:07.255 5451 5451 E Qt : at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:423)
07-18 07:09:07.255 5451 5451 E Qt : at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:166)
07-18 07:09:07.255 5451 5451 E Qt : at org.qtproject.qt5.android.bindings.QtActivity.onCreateHook(QtActivity.java:267)
07-18 07:09:07.255 5451 5451 E Qt : at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:274)
07-18 07:09:07.255 5451 5451 E Qt : at net.vplay.helper.VPlayActivity.onCreate(VPlayActivity.java:20)
07-18 07:09:07.255 5451 5451 E Qt : at android.app.Activity.performCreate(Activity.java:7185)
07-18 07:09:07.255 5451 5451 E Qt : at android.app.Activity.performCreate(Activity.java:7176)
07-18 07:09:07.255 5451 5451 E Qt : at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1284)
07-18 07:09:07.255 5451 5451 E Qt : at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2895)
07-18 07:09:07.255 5451 5451 E Qt : at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3050)
07-18 07:09:07.255 5451 5451 E Qt : at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
07-18 07:09:07.255 5451 5451 E Qt : at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
07-18 07:09:07.255 5451 5451 E Qt : at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
07-18 07:09:07.255 5451 5451 E Qt : at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1810)
07-18 07:09:07.255 5451 5451 E Qt : at android.os.Handler.dispatchMessage(Handler.java:106)
07-18 07:09:07.255 5451 5451 E Qt : at android.os.Looper.loop(Looper.java:193)
07-18 07:09:07.255 5451 5451 E Qt : at android.app.ActivityThread.main(ActivityThread.java:6704)
07-18 07:09:07.255 5451 5451 E Qt : at java.lang.reflect.Method.invoke(Native Method)
07-18 07:09:07.255 5451 5451 E Qt : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:518)
07-18 07:09:07.255 5451 5451 E Qt : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
07-18 07:09:07.266 1882 1890 W System : A resource failed to call close.
It already took me quite some time to get the APK built by updating the Manifest and gradle properties.
MinSdkVersion is set to 21, target to 22.
I’m building with gradle-5.6.4 – the build.gradle is:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://sdk.v-play.net/maven/' }
}
}
apply plugin: 'com.android.application'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
}
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!
*******************************************************/
compileSdkVersion androidCompileSdkVersion.toInteger()
buildToolsVersion '28.0.3'
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']
}
}
lintOptions {
abortOnError false
}
tasks.withType(JavaCompile) {
options.incremental = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Do not compress Qt binary resources file
aaptOptions {
noCompress 'rcc'
}
defaultConfig {
resConfig "en"
minSdkVersion = qtMinSdkVersion
targetSdkVersion = qtTargetSdkVersion
}
}
dependencies {
compile 'com.android.support:support-v4:22.2.1'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'net.vplay.plugins:plugin-hockeyapp:3.+'
compile 'net.vplay.plugins:plugin-notification:3.+'
compile 'net.vplay.plugins:plugin-soomla:3.+'
}
Has anyone had a similar problem before and can point me in the right direction?
Thank you,
Martin