Couldn't load shared library 'gdx' for target

后端 未结 4 923
没有蜡笔的小新
没有蜡笔的小新 2021-01-18 17:18

I\'m having the same issue as in this question, but the answers there doesn\'t solve my problem.

I didn\'t create project by gdxsetup.jar, I just included gdx.jar an

4条回答
  •  时光说笑
    2021-01-18 17:51

    I actually just faced the same problem after I uploaded by first update to my app ("October Bro"). While the first release has been run perfectly when installed from the Play Store, the update crashed right after launching. Checking Logcat, I exactly have been facing this issue.

    The reason why my first release worked without a problem, but not the update was simple: because I only wanted to fix a minor bug, I checked out the project from GitHub, only ran the Desktop app once to verify the fix, and then created the signed AppBundle right away. It looks like I simply had to run the "android" run configuration at least once, before creating the AppBundle. Or to be more precise, the build.grade of the android module, which performs these tasks:

    // android/build.gradle
    
    ...
    
    // called every time gradle gets executed, takes the native dependencies of
    // the natives configuration, and extracts them to the proper libs/ folders
    // so they get packed with the APK.
    task copyAndroidNatives {
        doFirst {
            file("libs/armeabi/").mkdirs()
            file("libs/armeabi-v7a/").mkdirs()
            file("libs/arm64-v8a/").mkdirs()
            file("libs/x86_64/").mkdirs()
            file("libs/x86/").mkdirs()
    
            configurations.natives.files.each { jar ->
                def outputDir = null
                if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
                if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
                if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
                if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
                if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
                if(outputDir != null) {
                    copy {
                        from zipTree(jar)
                        into outputDir
                        include "*.so"
                    }
                }
            }
        }
    }
    

    I thought that this android/build.gradle is executed anyways once I hit Build > Build Bundle(s) / APK(s). But that does not seem to be the case.

提交回复
热议问题