Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting to Android AAB is missing assets (regression from #52526) #53328

Closed
daansystems opened this issue Oct 2, 2021 · 11 comments · Fixed by #53677
Closed

Exporting to Android AAB is missing assets (regression from #52526) #53328

daansystems opened this issue Oct 2, 2021 · 11 comments · Fixed by #53677

Comments

@daansystems
Copy link

Godot version

3.x

System information

Windows 10

Issue description

It seems the custom android export to aab no longer includes the assets of the project, could this have anything
to do with commit 35a98d3 "Add support for Play Asset Delivery."
Exporting an apk works fine. Is is possible to disable this assetPacks feature?

Steps to reproduce

Install Android build template, Use custom build, Select Export AAB, close the export dialog. Run the project on an android device/emulator, it will crash on start.

Minimal reproduction project

No response

@daansystems
Copy link
Author

daansystems commented Oct 2, 2021

bundlefail.zip

A small example project. I had to remove the android/build/libs/debug/godot-lib.debug.aar from zip, else the upload file is too large.
It was compiled using the current head of 3.x

@m4gr3d
Copy link
Contributor

m4gr3d commented Oct 2, 2021

@daansystems can you specify the commands you're using to run the project, and which version of Android you're running the project on.
Can you also provide the crash stack trace.

@jimbofoo
Copy link

jimbofoo commented Oct 2, 2021

@m4gr3d , I'm just clicking the run on android device icon in godot's main window.
here's the build config:

ext.versions = [
    androidGradlePlugin: '4.2.1',
    compileSdk         : 29,
    minSdk             : 18,
    targetSdk          : 29,
    buildTools         : '30.0.3',
    supportCoreUtils   : '1.0.0',
    kotlinVersion      : '1.5.10',
    v4Support          : '1.0.0',
    javaVersion        : 1.8,
    ndkVersion         : '21.4.7075529' // Also update 'platform/android/detect.py#get_project_ndk_version()' when this is updated.
]

The stacktrace of the crash:

10-02 17:31:16.734 12222 12222 W System.err: java.io.FileNotFoundException: _cl_
10-02 17:31:16.735 12222 12222 W System.err:    at android.content.res.AssetManager.nativeOpenAsset(Native Method)
10-02 17:31:16.735 12222 12222 W System.err:    at android.content.res.AssetManager.open(AssetManager.java:874)
10-02 17:31:16.735 12222 12222 W System.err:    at android.content.res.AssetManager.open(AssetManager.java:851)
10-02 17:31:16.735 12222 12222 W System.err:    at org.godotengine.godot.Godot.parseCommandLine(Godot.java:497)
10-02 17:31:16.736 12222 12222 W System.err:    at org.godotengine.godot.Godot.getCommandLine(Godot.java:480)
10-02 17:31:16.736 12222 12222 W System.err:    at org.godotengine.godot.Godot.onCreate(Godot.java:614)
10-02 17:31:16.736 12222 12222 W System.err:    at androidx.fragment.app.Fragment.performCreate(Fragment.java:2414)
10-02 17:31:16.736 12222 12222 W System.err:    at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1418)
10-02 17:31:16.737 12222 12222 W System.err:    at androidx.fragment.app.FragmentTransition.addToFirstInLastOut(FragmentTransition.java:1195)
10-02 17:31:16.737 12222 12222 W System.err:    at androidx.fragment.app.FragmentTransition.calculateFragments(FragmentTransition.java:1078)
10-02 17:31:16.737 12222 12222 W System.err:    at androidx.fragment.app.FragmentTransition.startTransitions(FragmentTransition.java:117)
10-02 17:31:16.737 12222 12222 W System.err:    at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2408)
10-02 17:31:16.737 12222 12222 W System.err:    at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
10-02 17:31:16.737 12222 12222 W System.err:    at androidx.fragment.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:2243)
10-02 17:31:16.737 12222 12222 W System.err:    at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:654)
10-02 17:31:16.737 12222 12222 W System.err:    at org.godotengine.godot.FullScreenGodotApp.onCreate(FullScreenGodotApp.java:61)
10-02 17:31:16.737 12222 12222 W System.err:    at com.godot.game.GodotApp.onCreate(GodotApp.java:45)
10-02 17:31:16.737 12222 12222 W System.err:    at android.app.Activity.performCreate(Activity.java:8000)
10-02 17:31:16.737 12222 12222 W System.err:    at android.app.Activity.performCreate(Activity.java:7984)
10-02 17:31:16.738 12222 12222 W System.err:    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
10-02 17:31:16.738 12222 12222 W System.err:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
10-02 17:31:16.738 12222 12222 W System.err:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
10-02 17:31:16.738 12222 12222 W System.err:    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
10-02 17:31:16.739 12222 12222 W System.err:    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
10-02 17:31:16.739 12222 12222 W System.err:    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
10-02 17:31:16.739 12222 12222 W System.err:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
10-02 17:31:16.739 12222 12222 W System.err:    at android.os.Handler.dispatchMessage(Handler.java:106)
10-02 17:31:16.739 12222 12222 W System.err:    at android.os.Looper.loop(Looper.java:223)
10-02 17:31:16.739 12222 12222 W System.err:    at android.app.ActivityThread.main(ActivityThread.java:7656)
10-02 17:31:16.739 12222 12222 W System.err:    at java.lang.reflect.Method.invoke(Native Method)
10-02 17:31:16.739 12222 12222 W System.err:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
10-02 17:31:16.739 12222 12222 W System.err:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

10-02 17:31:17.069 12222 12275 E godot   : ERROR: Couldn't load file 'res://project.binary', error code 19.
10-02 17:31:17.071 12222 12275 E godot   :    at: _load_settings_text_or_binary (core\project_settings.cpp:600) - Couldn't load file 'res://project.binary', error code 19.

This is probably caused by the missing of the assets directory in the apk/bundle.

@akien-mga
Copy link
Member

akien-mga commented Oct 2, 2021

It could also be a version mismatch. Did you generate and install the custom build template from the exact same commit that you use for the editor? Alternatively, do you have this issue with official 3.4 beta 5 builds (also making sure to reinstall the source template with that version)?

Edit: error 19 is ERR_FILE_MISSING_DEPENDENCIES so that does seem to confirm some missing or incompatible files.

@m4gr3d
Copy link
Contributor

m4gr3d commented Oct 2, 2021

@jimbofoo This looks like a version mismatch. Your compileSdk version is 29 while the version with play asset delivery support should be 30.
Make sure you delete you're android directory in the project and recreate it using the Install Android Build Template... option.

Also for additional info, clicking the android icon in the editor always uses the apk export format regardless of the export format set in the editor export window, so it's not subject to the play asset delivery logic.

@daansystems
Copy link
Author

daansystems commented Oct 2, 2021

I can reproduce the issue with the build from:
https://downloads.tuxfamily.org/godotengine/3.4/beta5/
I've reinstalled the android build template from the export templates.

I have uploaded the full project with the android custom build here:
https://www.daansystems.com/tmp/godot_issue_53328.zip

I've also created a little movie displaying the issue

New.video.mp4

@akien-mga akien-mga changed the title Exporting to Android aab is missing assets Exporting to Android AAB is missing assets Oct 11, 2021
@akien-mga
Copy link
Member

akien-mga commented Oct 11, 2021

I can reproduce the issue with 3.4 beta 6 and the test project in #53328 (comment).

The AAB doesn't seem to include any assets aside from the icons indeed.

Edit: I do see the assets actually under installTime:
Screenshot_20211011_162759

But apparently they're not found/put in the expect place when installing the AAB?

@akien-mga akien-mga changed the title Exporting to Android AAB is missing assets Exporting to Android AAB is missing assets (regression from #52526) Oct 11, 2021
@akien-mga
Copy link
Member

I confirmed that it's a regression from #52526, a local revert of that PR seems to solve the issue.

@m4gr3d
Copy link
Contributor

m4gr3d commented Oct 11, 2021

@daansystems Thanks for the video, it gives me an idea of what the issue is.

@jimbofoo
Copy link

jimbofoo commented Oct 11, 2021

I think the issue is not in the AAB (it includes the assets with the new Play Asset delivery structure). But in the generated APK when clicking run while AAB export format is selected. So the title of this issue needs to be something like "APK misses assets when export format is set to AAB". Sorry for the confusion.

@m4gr3d
Copy link
Contributor

m4gr3d commented Oct 11, 2021

@jimbofoo That's correct! I found the issue though and will be pushing a fix shortly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment