Defold: Bob --settings not change package name and app title for android

Created on 13 Feb 2021  路  7Comments  路  Source: defold/defold

Describe the bug (REQUIRED)
Build dev apk in bob.
Dev apk use another package name and title

bob script

java -jar bob/bob.jar  clean resolve --archive --variant debug --settings debug_game.project_settings build
java -jar bob/bob.jar --platform=armv7-android --with-symbols --strip-executable  --variant debug --settings debug_game.project_settings bundle --bo bob/dev/android --keystore bob/debug.jks --keystore-pass bob/debug_password.txt --keystore-alias game

debug_game.project_settings

[project]
title = community DEV

[android]
package = com.community.game.dev

[game]
version = dev

1)Apk do not change package name
2)Apk do not change title
3)Apk can't start

com.community.game is game.project package name.

2021-02-13 18:03:29.727 8555-8555/com.community.game E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.community.game, PID: 8555
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.community.game/com.dynamo.android.DefoldActivity}: java.lang.IllegalArgumentException: Unable to find native library community using classloader: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.community.game-cNpvEcfncDbTxuTzL4TqjA==/base.apk"],nativeLibraryDirectories=[/data/app/com.community.game-cNpvEcfncDbTxuTzL4TqjA==/lib/arm64, /data/app/com.community.game-cNpvEcfncDbTxuTzL4TqjA==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]]
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2951)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6718)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
     Caused by: java.lang.IllegalArgumentException: Unable to find native library community using classloader: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.community.game-cNpvEcfncDbTxuTzL4TqjA==/base.apk"],nativeLibraryDirectories=[/data/app/com.community.game-cNpvEcfncDbTxuTzL4TqjA==/lib/arm64, /data/app/com.community.game-cNpvEcfncDbTxuTzL4TqjA==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]]
        at android.app.NativeActivity.onCreate(NativeActivity.java:161)
        at com.dynamo.android.DefoldActivity.onCreate(DefoldActivity.java:217)
        at android.app.Activity.performCreate(Activity.java:7144)
        at android.app.Activity.performCreate(Activity.java:7135)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)聽
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)聽
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)聽
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)聽
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)聽
        at android.os.Handler.dispatchMessage(Handler.java:106)聽
        at android.os.Looper.loop(Looper.java:193)聽
        at android.app.ActivityThread.main(ActivityThread.java:6718)聽
        at java.lang.reflect.Method.invoke(Native Method)聽
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)聽
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)聽

To Reproduce (REQUIRED)
Steps to reproduce the behavior:
1)Create settings file to bob. With new android package
2)Build apk with bob with --settings

Expected behavior (REQUIRED)
1)changing android package in settings file change apk package name.

Defold version (REQUIRED):

  • Version [e.g. 1.2.179]

Platforms (REQUIRED):

  • Platforms: Android
bob bug

Most helpful comment

Thanks. I add build to every bundle. And now it worked as excepted.

All 7 comments

In a first test, I couldn't reproduce it.

In main.script init():

print("project.title =", sys.get_config("project.title", ""))
print("android.package =", sys.get_config("android.package", ""))
print("game.version =", sys.get_config("game.version", ""))

with just game.project

02-17 11:32:59.813 25470 25515 D defold : DEBUG:SCRIPT: project.title = community DEFAULT
02-17 11:32:59.813 25470 25515 D defold : DEBUG:SCRIPT: android.package = com.community.game.default
02-17 11:32:59.813 25470 25515 D defold : DEBUG:SCRIPT: game.version = default

with test.settings

02-17 11:35:19.228 25642 25673 D defold : DEBUG:SCRIPT: project.title = community DEV
02-17 11:35:19.228 25642 25673 D defold : DEBUG:SCRIPT: android.package = com.community.game.dev
02-17 11:35:19.228 25642 25673 D defold : DEBUG:SCRIPT: game.version = dev

Note that you don't specify platform when you build content, so you'll get the host platform's content.
Next, you bundle for Android. COuld it be that it picks up old built files? I.e. when you last built for Android?

Thanks
1) I will try to add platform build
So for every platform, i need first build. Then bundle?

I was always think, that build is for building content, and content is same, so i need to build it only once)

2) I make clean. So it can't take prev build file?
java -jar bob/bob.jar clean resolve --archive --variant debug --settings debug_game.project_settings build

If you look in Android launcher.
Is game name equals title?
Also is game package name for Android settings/applications equals android.package?

Thanks. I add build to every bundle. And now it worked as excepted.

Thanks. I add build to every bundle. And now it worked as excepted.

Thank you for confirming that it works as expected. Closing.

Was this page helpful?
0 / 5 - 0 ratings