manifest file seems to be ignored
-
Hi all -
I've gotten my app to run on a tablet; now it's time to start making it look right. I made two changes to my AndroidManifest.xml file (via Creator): added a file for the icon, and specified landscape mode.
I rebuilt and redeployed, and my changes didn't occur. Do I need to do something to tell Creator to actually use the AndroidManifest.xml file I've modified?
Thanks...
EDIT: here's my file (in an android subfolder of my project):
<?xml version="1.0"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.fluidra.ngademo" android:installLocation="auto" android:versionCode="-- %%1.0%% --" android:versionName="-- %%INSERT_VERSION_NAME%% --"> <!-- %%INSERT_PERMISSIONS --> <!-- %%INSERT_FEATURES --> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/> <application android:name="org.qtproject.qt.android.bindings.QtApplication" android:hardwareAccelerated="true" android:label="-- %%NGA demo%% --" android:requestLegacyExternalStorage="true" android:allowNativeHeapPointerTagging="false" android:allowBackup="true" android:fullBackupOnly="false" android:icon="@drawable/icon"> <activity android:name="org.qtproject.qt.android.bindings.QtActivity" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:label="-- %%INSERT_APP_NAME%% --" android:launchMode="singleTop" android:screenOrientation="landscape" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/> <meta-data android:name="android.app.arguments" android:value="-- %%INSERT_APP_ARGUMENTS%% --"/> <meta-data android:name="android.app.extract_android_style" android:value="default"/> </activity> </application> </manifest>
-
@JoeCFD that's fine, but neither of my changes occurred on the tablet. The app still shows up with the default icon, and in portrait mode. It seems that my changes are being ignored. Is there a run setting I need to specify in order to get this working correctly?
-
question, did you actually create the android templates
or are you trying to modify the auto generated android manifest file, that is remade on each compilation ?
-
@J-Hilk said in manifest file seems to be ignored:
question, did you actually create the android templates
[...]
or are you trying to modify the auto generated android manifest file, that is remade on each compilation ?I created the templates. They got put into an "android" subfolder to my project. When I pressed "Create Templates," it put me into a form editor for AndroidManifest.xml. I made my changes there and saved them.
-
@mzimmers I did this on Linux. I copied the apk file to Download dir of my Tablet and do not have any problem to open it for installation. It is a Windows thing and I have no idea. Maybe right click the file to see if there are read, write and executable privileges.
-
To figure out if the Manifest is included, you can just look at the generated APK and check if the file in there is the same as the one you created.
Notice that the apk is a zip file and can be read by any zip app (on Windows you may need to rename it).I noticed on the latest Qt Creator a behavior that may be a bug; on a clean new project I created manifest and Creator popped up a notice saying it could not modify my cmake to register it. The one it created just a minute before and I didn't modify at all...
Possibly that is what went wrong for you too and you need to alter your cmake to point to your android subdir, where it expects to find the manifest.
-
@TomZ yeah, I'm still trying to figure out what I'm supposed to put into the android directory.
I did unzip the .apk file and there was an AndroidManifest.xml file in it. Oddly, though, it was full of non-printing characters interspersed with the XML. I guess it's formatting it for the Android platform?
EDIT:
TomZ you were 100% right. Turns out I needed to add this to my CMakeLists.txt file:
set_property(TARGET appnga_demo APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android )
Both my icon and landscape mode are now as specified in the AndroidManifest.xml file.
Thanks!
-
-
@J-Hilk yeah, I was wondering about that since my app seemed to remain on the tablet after I quit Creator.
I will need to use the APK file for internal distribution (I'm working on a demo for sales/marketing to use). According to the people in one of the Android forums, the pre-supplied file manager for Android is fairly poor. I installed something called Solid Explorer, and now can at least get my APK file onto the tablet. Next step is to try installing from it.