Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt6.5.0: Resource theme link error
Qt 6.11 is out! See what's new in the release blog

Qt6.5.0: Resource theme link error

Scheduled Pinned Locked Moved Solved Qt 6
2 Posts 1 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheoSys
    wrote on last edited by
    #1

    I try to port an app for Android running with Qt5.15 to Qt6.5.0. The code is already ported and compiles fine. Everything but the manifest file seems to compile. I fixed the qt5 part in the paths. Here is the top of my manifest file

    <?xml version="1.0"?>
    <manifest
        package="org.qtproject.theosys"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:versionName="-- %%INSERT_VERSION_NAME%% --"
        android:versionCode="-- %%INSERT_VERSION_CODE%% --"
        android:installLocation="auto"
        android:requestLegacyExternalStorage="true">
        <!-- %%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.android.qt.android.bindings.QtApplication"
            android:label="-- %%INSERT_APP_NAME%% --"
            android:extractNativeLibs="true"
            android:requestLegacyExternalStorage="true"
            android:allowNativeHeapPointerTagging="false"
            android:allowBackup="true"
            android:fullBackupOnly="false"
            android:icon="@drawable/icon"
            android:theme="@style/Theme.AppCompat.NoActionBar">
            <activity
                android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
                android:name="org.qtproject.qt.android.bindings.QtActivity"
                android:label="-- %%INSERT_APP_NAME%% --"
                android:launchMode="singleTop"
                android:screenOrientation="nosensor"
                android:exported="true">
    [...]
    

    And here is the error I get:

    FAILURE: Build completed with 2 failures.
    
    1: Task failed with an exception.
    -----------
    * What went wrong:
    Execution failed for task ':processReleaseResources'.
    > A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
       > Android resource linking failed
         error: resource style/Theme.AppCompat.NoActionBar (aka org.qtproject.theosys:style/Theme.AppCompat.NoActionBar) not found.
         error: resource style/Theme.AppCompat.NoActionBar (aka org.qtproject.theosys:style/Theme.AppCompat.NoActionBar) not found.
         error: resource style/Theme.AppCompat (aka org.qtproject.theosys:style/Theme.AppCompat) not found.
         error: failed linking references.
    
    
    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    ==============================================================================
    

    What is wrong with the theme? It worked this way wth Qt5. What do I miss?

    A.T.

    T 1 Reply Last reply
    0
    • T TheoSys

      I try to port an app for Android running with Qt5.15 to Qt6.5.0. The code is already ported and compiles fine. Everything but the manifest file seems to compile. I fixed the qt5 part in the paths. Here is the top of my manifest file

      <?xml version="1.0"?>
      <manifest
          package="org.qtproject.theosys"
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:versionName="-- %%INSERT_VERSION_NAME%% --"
          android:versionCode="-- %%INSERT_VERSION_CODE%% --"
          android:installLocation="auto"
          android:requestLegacyExternalStorage="true">
          <!-- %%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.android.qt.android.bindings.QtApplication"
              android:label="-- %%INSERT_APP_NAME%% --"
              android:extractNativeLibs="true"
              android:requestLegacyExternalStorage="true"
              android:allowNativeHeapPointerTagging="false"
              android:allowBackup="true"
              android:fullBackupOnly="false"
              android:icon="@drawable/icon"
              android:theme="@style/Theme.AppCompat.NoActionBar">
              <activity
                  android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
                  android:name="org.qtproject.qt.android.bindings.QtActivity"
                  android:label="-- %%INSERT_APP_NAME%% --"
                  android:launchMode="singleTop"
                  android:screenOrientation="nosensor"
                  android:exported="true">
      [...]
      

      And here is the error I get:

      FAILURE: Build completed with 2 failures.
      
      1: Task failed with an exception.
      -----------
      * What went wrong:
      Execution failed for task ':processReleaseResources'.
      > A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
         > Android resource linking failed
           error: resource style/Theme.AppCompat.NoActionBar (aka org.qtproject.theosys:style/Theme.AppCompat.NoActionBar) not found.
           error: resource style/Theme.AppCompat.NoActionBar (aka org.qtproject.theosys:style/Theme.AppCompat.NoActionBar) not found.
           error: resource style/Theme.AppCompat (aka org.qtproject.theosys:style/Theme.AppCompat) not found.
           error: failed linking references.
      
      
      * Try:
      > Run with --stacktrace option to get the stack trace.
      > Run with --info or --debug option to get more log output.
      > Run with --scan to get full insights.
      ==============================================================================
      

      What is wrong with the theme? It worked this way wth Qt5. What do I miss?

      A.T.

      T Offline
      T Offline
      TheoSys
      wrote on last edited by
      #2

      I've to answer my own question. The problem was that I had do add a dependency to the file build.gradle. The section should look like:

      dependencies {
          implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
          implementation 'com.google.android.material:material:1.0.0'
          implementation 'androidx.preference:preference:1.1.0'
      }
      

      The second dependency ('androidx.preference:preference:1.1.0) is necessary if you use the new setup system (preferences) from Android.

      A.T.

      1 Reply Last reply
      1
      • T TheoSys has marked this topic as solved on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved