Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Android Manifest version update



  • Hi all,

    there are some escape sequences which can be used in AndroidManifest.xml to automatically set values according to Qt project settings like:

    • -- %%INSERT_APP_LIB_NAME%% --
    • -- %%INSERT_APP_NAME%% --

    Do somebody know if a sequence exists to insert VERSION which is defined PRO file?
    Is it possible to get an exhaustive list of all available escape sequences?



  • @KroMignon I reply to myself, I think this could be useful for other developers.

    Escape sequences which I found (extract from source code!):

    • -- %%INSERT_APP_NAME%% -- correspond to qmake setting TARGET
    • -- %%INSERT_APP_LIB_NAME%% -- (same as above)
    • -- %%INSERT_VERSION_NAME%% -- correspond to qmake setting ANDROID_VERSION_NAME
    • -- %%INSERT_VERSION_CODE%% -- correspond to qmake setting ANDROID_VERSION_CODE


  • @KroMignon I reply to myself, I think this could be useful for other developers.

    Escape sequences which I found (extract from source code!):

    • -- %%INSERT_APP_NAME%% -- correspond to qmake setting TARGET
    • -- %%INSERT_APP_LIB_NAME%% -- (same as above)
    • -- %%INSERT_VERSION_NAME%% -- correspond to qmake setting ANDROID_VERSION_NAME
    • -- %%INSERT_VERSION_CODE%% -- correspond to qmake setting ANDROID_VERSION_CODE


  • @KroMignon

    While looking for a way to use INSERT_VERSION_NAME and INSERT_VERSION_CODE I came across your post.

    I have added to my .pro

    ANDROID_VERSION_NAME = "3"
    ANDROID_VERSION_CODE = 2.4.0
    

    This is similar as I used before in creator's manifest editor.
    However, when rerun qmake and deploy my app I got

    * What went wrong:
    Execution failed for task ':processDebugResources'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
       > Android resource linking failed
         R:\build-App1-Android_for_armeabi_v7a_arm64_v8a_x86_x86_64_Clang_Qt_5_14_2_for_Android-Release\android-build\build\intermediates\merged_manifests\debug\AndroidManifest.xml:2: AAPT: error: invalid android:versionCode '2.4.0'.
    
    

    I have checked also with same result

    ANDROID_VERSION_NAME = "3"
    ANDROID_VERSION_CODE = "2.4.0"
    

    What is missing?



  • The problem was between keybord and chair. The values have to be exchanged.

    ANDROID_VERSION_CODE = "3"
    ANDROID_VERSION_NAME = "2.4.0"
    

    Then it is working again.


Log in to reply