Android manifest variable
-
Hi,
according to this post, which says:-- %%INSERT_APP_NAME%% -- correspond to qmake setting TARGET
And the documentation here, which states:
TARGET Specifies the name of the target file. Contains the base name of the project file by default. For example: [...] TARGET = myapp [...] The project file above would produce an executable named myapp on unix and myapp.exe on Windows.
I have added the following in my .pro file:
TARGET = MahlZahl
When I use this, the application is being built and deployed to Android, but will stop with the error message
Your application encountered a fatal error and cannot continue
before any possibility to debug it. Using small letters only for the app name or changing "=" to "+=" doesn't change a thing.
Building and running the same project in Windows works well.My application output shows (please note, that I am not using "containsKey" in my code!):
W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.Bundle.containsKey(java.lang.String)' on a null object reference W System.err: at org.qtproject.qt5.android.QtNative$4.run(QtNative.java:495) W System.err: at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87) W System.err: at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61) W System.err: at java.lang.Thread.run(Thread.java:764) W System.err: java.lang.Exception: W System.err: at org.qtproject.qt5.android.bindings.QtLoader.loadApplication(QtLoader.java:268) W System.err: at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:505) W System.err: at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:166) W System.err: at org.qtproject.qt5.android.bindings.QtActivity.onCreateHook(QtActivity.java:267) W System.err: at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:274) W System.err: at android.app.Activity.performCreate(Activity.java:7136) W System.err: at android.app.Activity.performCreate(Activity.java:7127) W System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) W System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908) W System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3063) W System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) W System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) W System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) W System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823) W System.err: at android.os.Handler.dispatchMessage(Handler.java:107) W System.err: at android.os.Looper.loop(Looper.java:198) W System.err: at android.app.ActivityThread.main(ActivityThread.java:6729) W System.err: at java.lang.reflect.Method.invoke(Native Method) W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
Developing on a Win10 machine with Qt 5.15.2 with Qt Creator 4.14.1., targeting a Nokia 8 with Android-Version 9
P.S.: This is a redefinition of an unanswered question from some 15hs before, that I've just deleted. As I have new information I didn't want the other thread to be unnecessarily cluttered.
-
Hi,
according to this post, which says:-- %%INSERT_APP_NAME%% -- correspond to qmake setting TARGET
And the documentation here, which states:
TARGET Specifies the name of the target file. Contains the base name of the project file by default. For example: [...] TARGET = myapp [...] The project file above would produce an executable named myapp on unix and myapp.exe on Windows.
I have added the following in my .pro file:
TARGET = MahlZahl
When I use this, the application is being built and deployed to Android, but will stop with the error message
Your application encountered a fatal error and cannot continue
before any possibility to debug it. Using small letters only for the app name or changing "=" to "+=" doesn't change a thing.
Building and running the same project in Windows works well.My application output shows (please note, that I am not using "containsKey" in my code!):
W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.Bundle.containsKey(java.lang.String)' on a null object reference W System.err: at org.qtproject.qt5.android.QtNative$4.run(QtNative.java:495) W System.err: at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87) W System.err: at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61) W System.err: at java.lang.Thread.run(Thread.java:764) W System.err: java.lang.Exception: W System.err: at org.qtproject.qt5.android.bindings.QtLoader.loadApplication(QtLoader.java:268) W System.err: at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:505) W System.err: at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:166) W System.err: at org.qtproject.qt5.android.bindings.QtActivity.onCreateHook(QtActivity.java:267) W System.err: at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:274) W System.err: at android.app.Activity.performCreate(Activity.java:7136) W System.err: at android.app.Activity.performCreate(Activity.java:7127) W System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) W System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908) W System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3063) W System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) W System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) W System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) W System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823) W System.err: at android.os.Handler.dispatchMessage(Handler.java:107) W System.err: at android.os.Looper.loop(Looper.java:198) W System.err: at android.app.ActivityThread.main(ActivityThread.java:6729) W System.err: at java.lang.reflect.Method.invoke(Native Method) W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
Developing on a Win10 machine with Qt 5.15.2 with Qt Creator 4.14.1., targeting a Nokia 8 with Android-Version 9
P.S.: This is a redefinition of an unanswered question from some 15hs before, that I've just deleted. As I have new information I didn't want the other thread to be unnecessarily cluttered.
-
@KroMignon said in Android manifest variable:
Do you use -- %%INSERT_APP_NAME%% -- in you AndroidManifest?
Can you show where?Thanks for your answer, @KroMignon! Of course I can:
<?xml version="1.0"?> <manifest package="de.myurl.myapp" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="-- %%INSERT_VERSION_NAME%% --" android:versionCode="-- %%INSERT_VERSION_CODE%% --" android:installLocation="auto"> <!-- %%INSERT_PERMISSIONS --> <!-- %%INSERT_FEATURES --> <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true" android:icon="@drawable/icon"> <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="userLandscape" android:launchMode="singleTop"> [...other stuff...] </activity> </application> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="24"/> </manifest>
It's in there twice, once in the <aplication... tag and once in the <activity... tag.
Both times asandroid:label="-- %%INSERT_APP_NAME%% --"
My .pro successfully defines version code and version name this way:
ANDROID_VERSION_CODE = "0" ANDROID_VERSION_NAME = "0.0.1"
-
So I run into that just recently.
After 2 days of debugging and trying I found the error.
For me it was white spaces
My App Project.pro
in the project file. Once I changed that toMyAppProject.pro
the error went away.Strange that it used to work with whitespaces just fine. In fact, IIRC, the only way to have an application name under the icon on the android device that had white spaces in it, was via renaming the project file.
It would not work via the ManifestInterface, nor viaTARGET
setting inside the pro file.Now the Application name inside the ManifestInterface can have the whitespaces, but the project file not.
-
So I run into that just recently.
After 2 days of debugging and trying I found the error.
For me it was white spaces
My App Project.pro
in the project file. Once I changed that toMyAppProject.pro
the error went away.Strange that it used to work with whitespaces just fine. In fact, IIRC, the only way to have an application name under the icon on the android device that had white spaces in it, was via renaming the project file.
It would not work via the ManifestInterface, nor viaTARGET
setting inside the pro file.Now the Application name inside the ManifestInterface can have the whitespaces, but the project file not.
@J-Hilk White spaces are evil :-)
-
S SeDi has marked this topic as solved on