Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › Android failed with out of memory

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #24942

    Patrik Dusek

    Hi all,

    I tried after a some months to compile a older project of mine and it fails with:

    “Execution failed for task ‘:packageDebug’.
    > A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
    > java.lang.OutOfMemoryError (no error message)

    11:14:17: Starting: "C:\Felgo2022\Felgo\android\bin\androiddeployqt.exe" --input C:/Users/patrik/Documents/GitHub/build/Reader2023Redesign/android-Reader-deployment-settings.json --output C:/Users/patrik/Documents/GitHub/build/Reader2023Redesign/android-build --android-platform android-31 --jdk "C:/Program Files/Eclipse Adoptium/jdk-11.0.15.10-hotspot" --gradle
    Generating Android Package
      Input file: C:/Users/patrik/Documents/GitHub/build/Reader2023Redesign/android-Reader-deployment-settings.json
      Output directory: C:/Users/patrik/Documents/GitHub/build/Reader2023Redesign/android-build/
      Application binary: Reader
      Android build platform: android-31
      Install to device: No
      -- Skipping C:/Felgo2022/Felgo/android/plugins/position/libplugins_position_qtposition_serialnmea_arm64-v8a.so. It has unmet dependencies: lib/libQt5SerialPort_arm64-v8a.so.
      -- Skipping C:/Felgo2022/Felgo/android/plugins/renderplugins/libplugins_renderplugins_scene2d_arm64-v8a.so. It has unmet dependencies: lib/libQt53DQuickScene2D_arm64-v8a.so.
      -- Skipping C:/Felgo2022/Felgo/android/plugins/position/libplugins_position_qtposition_serialnmea_armeabi-v7a.so. It has unmet dependencies: lib/libQt5SerialPort_armeabi-v7a.so.
      -- Skipping C:/Felgo2022/Felgo/android/plugins/renderplugins/libplugins_renderplugins_scene2d_armeabi-v7a.so. It has unmet dependencies: lib/libQt53DQuickScene2D_armeabi-v7a.so.
    Warning: QML import could not be resolved in any of the import paths: NetworkInfo
    Warning: QML import could not be resolved in any of the import paths: Qt3D.Scene2D
    Warning: QML import could not be resolved in any of the import paths: QtQuick.tooling
    Warning: QML import could not be resolved in any of the import paths: Qt.labs.handlers
    Warning: QML import could not be resolved in any of the import paths: com.pd.thieme
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
    Warning: QML import could not be resolved in any of the import paths: NetworkInfo
    Warning: QML import could not be resolved in any of the import paths: Qt3D.Scene2D
    Warning: QML import could not be resolved in any of the import paths: QtQuick.tooling
    Warning: QML import could not be resolved in any of the import paths: Qt.labs.handlers
    Warning: QML import could not be resolved in any of the import paths: com.pd.thieme
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
    Starting a Gradle Daemon, 3 busy and 2 incompatible and 6 stopped Daemons could not be reused, use --status for details
    
    > Configure project :
    WARNING:The option setting 'android.bundle.enableUncompressedNativeLibs=false' is deprecated.
    The current default is 'true'.
    It will be removed in version 8.0 of the Android Gradle plugin.
    You can add the following to your build.gradle instead:
    android {
        packagingOptions {
            jniLibs {
                useLegacyPackaging = true
            }
        }
    }
    WARNING:The specified Android SDK Build Tools version (29.0.1) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.2.0.
    Android SDK Build Tools 30.0.3 will be used.
    To suppress this warning, remove "buildToolsVersion '29.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
    
    > Task :preBuild UP-TO-DATE
    > Task :preDebugBuild UP-TO-DATE
    > Task :mergeDebugNativeDebugMetadata NO-SOURCE
    > Task :doccheck:preBuild UP-TO-DATE
    > Task :doccheck:preDebugBuild UP-TO-DATE
    > Task :doccheck:compileDebugAidl NO-SOURCE
    > Task :doccheck:packageDebugRenderscript NO-SOURCE
    
    > Task :compileDebugRenderscript
    The RenderScript APIs are deprecated. They will be removed in Android Gradle plugin 9.0. See the following link for a guide to migrate from RenderScript: https://developer.android.com/guide/topics/renderscript/migrate
    
    > Task :generateDebugBuildConfig
    > Task :javaPreCompileDebug
    > Task :doccheck:writeDebugAarMetadata
    > Task :generateDebugResValues
    > Task :generateDebugResources
    > Task :processDebugGoogleServices
    > Task :compileDebugAidl
    > Task :doccheck:compileDebugRenderscript NO-SOURCE
    > Task :doccheck:generateDebugResValues
    > Task :doccheck:generateDebugResources
    > Task :checkDebugAarMetadata
    > Task :doccheck:packageDebugResources
    > Task :createDebugCompatibleScreenManifests
    > Task :extractDeepLinksDebug
    > Task :doccheck:extractDeepLinksDebug
    > Task :doccheck:compileDebugLibraryResources
    > Task :doccheck:processDebugManifest
    > Task :doccheck:parseDebugLocalResources
    > Task :mergeDebugResources
    
    > Task :processDebugMainManifest
    C:\Users\patrik\Documents\GitHub\build\Reader2023Redesign\android-build\AndroidManifest.xml:80:1-76 Warning:
    	Element uses-permission#android.permission.WRITE_EXTERNAL_STORAGE at AndroidManifest.xml:80:1-76 duplicated with element declared at AndroidManifest.xml:62:5-81
    C:\Users\patrik\Documents\GitHub\build\Reader2023Redesign\android-build\AndroidManifest.xml:81:1-62 Warning:
    	Element uses-permission#android.permission.INTERNET at AndroidManifest.xml:81:1-62 duplicated with element declared at AndroidManifest.xml:61:5-67
    C:\Users\patrik\Documents\GitHub\build\Reader2023Redesign\android-build\AndroidManifest.xml:82:1-74 Warning:
    	Element uses-permission#android.permission.ACCESS_NETWORK_STATE at AndroidManifest.xml:82:1-74 duplicated with element declared at AndroidManifest.xml:64:5-79
    C:\Users\patrik\Documents\GitHub\build\Reader2023Redesign\android-build\AndroidManifest.xml:83:2-75 Warning:
    	Element uses-permission#android.permission.ACCESS_FINE_LOCATION at AndroidManifest.xml:83:2-75 duplicated with element declared at AndroidManifest.xml:63:5-79
    C:\Users\patrik\Documents\GitHub\build\Reader2023Redesign\android-build\AndroidManifest.xml:84:2-77 Warning:
    	Element uses-permission#android.permission.ACCESS_COARSE_LOCATION at AndroidManifest.xml:84:2-77 duplicated with element declared at AndroidManifest.xml:67:5-81
    
    > Task :mapDebugSourceSetPaths
    > Task :processDebugManifest
    > Task :doccheck:generateDebugBuildConfig
    > Task :doccheck:javaPreCompileDebug
    > Task :processDebugManifestForPackage
    > Task :mergeDebugShaders
    > Task :compileDebugShaders NO-SOURCE
    > Task :generateDebugAssets UP-TO-DATE
    > Task :doccheck:mergeDebugShaders
    > Task :doccheck:compileDebugShaders NO-SOURCE
    > Task :doccheck:generateDebugAssets UP-TO-DATE
    > Task :doccheck:generateDebugRFile
    > Task :doccheck:packageDebugAssets
    > Task :mergeDebugAssets
    > Task :processDebugResources
    > Task :doccheck:compileDebugJavaWithJavac
    > Task :doccheck:bundleLibCompileToJarDebug
    > Task :processDebugJavaRes
    > Task :doccheck:processDebugJavaRes NO-SOURCE
    > Task :doccheck:bundleLibResDebug NO-SOURCE
    > Task :compressDebugAssets
    > Task :mergeDebugJavaResource
    
    > Task :compileDebugJavaWithJavac
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    
    > Task :checkDebugDuplicateClasses
    > Task :doccheck:bundleLibRuntimeToJarDebug
    > Task :desugarDebugFileDependencies
    > Task :mergeDebugJniLibFolders
    > Task :doccheck:mergeDebugJniLibFolders
    > Task :doccheck:mergeDebugNativeLibs NO-SOURCE
    > Task :doccheck:copyDebugJniLibsProjectOnly
    > Task :validateSigningDebug
    > Task :writeDebugAppMetadata
    > Task :writeDebugSigningConfigVersions
    > Task :doccheck:stripDebugDebugSymbols NO-SOURCE
    > Task :doccheck:copyDebugJniLibsProjectAndLocalJars
    > Task :doccheck:extractDebugAnnotations
    > Task :dexBuilderDebug
    > Task :mergeLibDexDebug
    > Task :mergeProjectDexDebug
    > Task :doccheck:mergeDebugGeneratedProguardFiles
    > Task :doccheck:mergeDebugConsumerProguardFiles
    > Task :doccheck:prepareDebugArtProfile
    > Task :doccheck:prepareLintJarForPublish
    > Task :doccheck:mergeDebugJavaResource
    > Task :doccheck:syncDebugLibJars
    > Task :doccheck:bundleDebugAar
    > Task :doccheck:assembleDebug
    > Task :mergeExtDexDebug
    > Task :mergeDebugNativeLibs
    
    > Task :stripDebugDebugSymbols
    [CXX5106] NDK was located by using ndk.dir property. This method is deprecated and will be removed in a future release. Please delete ndk.dir from local.properties and set android.ndkVersion to [21.3.6528147] in all native modules in the project. https://developer.android.com/r/studio-ui/ndk-dir
    
    > Task :packageDebug FAILED
    
    60 actionable tasks: 60 executed
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':packageDebug'.
    > A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
       > java.lang.OutOfMemoryError (no error message)
    
    * 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.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 32s
    Building the android package failed!
      -- For more information, run this command with --verbose.
    11:15:25: Der Prozess "C:\Felgo2022\Felgo\android\bin\androiddeployqt.exe" wurde mit dem Rückgabewert 14 beendet.
    Fehler beim Erstellen/Deployment des Projekts Reader (Kit: Android Qt 5.15.2 Clang Multi-Abi)
    Bei der Ausführung von Schritt "Build Android APK"

    Is there a way to alloc more memory to the jvm?

    I found this:

    gradle.properties.org.gradle.jvmargs=-xmx4608m

    but I have no idea where to put it.

    Thx,

    Patrik

     

     

    #24946

    Alex
    Felgo Team

    Hi Patrik,

    such you can put such gradle properties in your global gradle properties file, e.g. on Windows it is located at C:\Users\<your user>\.gradle

    If there is no such file yet, you can create a gradle.properties file yourself. E.g. mine has an entry like org.gradle.jvmargs=-Xmx4096M

    First of all however, pelase make sure that the project is correctly migrated to the latest version fo Felgo that you are using. E.g. following our changelog/migration guide or by creating a new blank project and adding your files (or comparing it with such an empty project).

    Best,
    Alex

    #24954

    Patrik Dusek

    Hi Alex,

    thx, that made it.

    best,

    Patrik

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded