Valentin H
Valentin H

Reputation: 7448

Qt on Android. After adding AndroidManifest.xml app doesn' start

I'm very new to Qt on Android. The app runs on android with developer mode activated. I create the apk, copy it manually to android and install. For changing the icon of the app I included AndroidManifest.xml in the project. The icon has changed indeed, but the app doesn't run any more. It closes immediately after start with a short dialog message.

I assume, it requires some resources which are not specified in the manifest. But how can I exactly know, why it stops. Are there any useful logs on android?

Upvotes: 1

Views: 561

Answers (1)

Mohammad Kanan
Mohammad Kanan

Reputation: 4582

After building your project with working apk, use same manifest generated by the build (Which usually includes necessary permissions your app is likely missing now).

create a folder in project source, any name, android-src , then copy AndroidManifest.xml from your build $build/android-build to newly created source folder. Next in your project add existing Files and select from newly created folder the AndroidManifest.xml, you can now edit the AndroidManifest.xml from your project other files and add/modify icon.

Your .pro should have an entry similar to:

android {
QT += androidextras
DISTFILES += \
        android/AndroidManifest.xml \
    ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-src
}

Then rebuild your project.

Upvotes: 1

Related Questions