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

ARFoundation not working on split Android App Bundle #941

Closed
msNEOANALOG opened this issue Feb 18, 2022 · 19 comments
Closed

ARFoundation not working on split Android App Bundle #941

msNEOANALOG opened this issue Feb 18, 2022 · 19 comments
Labels
bug A bug in an ARFoundation-related package fixed Fixed in newer release

Comments

@msNEOANALOG
Copy link

Hey all,
when we try to test our AR App using AR Foundation on Android via the Google Play Console it just does not work. The AR Content does not move relative to the camera. The app is bigger then 150MB so we have Player Settings>Publishing Settings>Split Application Binary = on. And we have to build as Android App Bundle for the Play Store. It works perfectly without splitting build&run on device.
We saw this article where splitting by architecture seems to solve the problem. But since Google updated the rules, we have to upload an AAB. Not several APKs.
We're stuck. Any ideas? Thanks!

@msNEOANALOG msNEOANALOG added the how to Explains how to accomplish something label Feb 18, 2022
@ankur-unity
Copy link
Collaborator

ankur-unity commented Feb 18, 2022

Split Application Binary does not split an Android app into APK and AAB (asset bundle). It creates APK and OBB files. To create an AAB file, use "Build App Bundle (Google Play)" option in the Build Settings > Android.
https://docs.unity3d.com/Manual/android-BuildProcess.html

@msNEOANALOG
Copy link
Author

Split Application Binary does not split an Android app into APK and AAB (asset bundle). It creates APK and OBB files. To create an AAB file, use "Build App Bundle (Google Play)" option in the Build Settings > Android. https://docs.unity3d.com/Manual/android-BuildProcess.html

Thanks ankur-unity. We are doing that. The problem is that ARFoundation does not work when the AAB is installed via Play Console. It shows no errors and initializes normally but the rotation and position of the camera is fixed.

@ankur-unity
Copy link
Collaborator

Thanks ankur-unity. We are doing that. The problem is that ARFoundation does not work when the AAB is installed via Play Console. It shows no errors and initializes normally but the rotation and position of the camera is fixed.

You mentioned in your original post that:

we have Player Settings>Publishing Settings>Split Application Binary = on

This will create an OBB file. You will need to turn that off to avoid this. You only need to check the option "Build Settings > Android > Build App Bundle (Google Play)" to create an AAB file.

@msNEOANALOG
Copy link
Author

Dear ankur-unity. Thanks for the reply. The thing is, that we have to split the AAB because it is bigger than 150MB and Google Play Console will not accept that. As soon as we split it, AR Foundation stops working properly.

We were not able to figure that out and are now moving to external addressables to make the app smaller and deploy it without splitting.

@Weimmer
Copy link

Weimmer commented Feb 25, 2022

Hi I think I have same issue as yours. When build the apk from unity, it works fine, but once I build the aab file and upload to google play console, it will generate a apk file, but the apk does not work, when the ar session active is, the app crashed...

@Weimmer
Copy link

Weimmer commented Feb 25, 2022

PLS let me know if you find any resolution for that... I will try my best to solve it, if I figur it out, I will come here to you same.

@msNEOANALOG
Copy link
Author

Hi I think I have same issue as yours. When build the apk from unity, it works fine, but once I build the aab file and upload to google play console, it will generate a apk file, but the apk does not work, when the ar session active is, the app crashed...

We do not have problems with AABs per se. Only when they are split. No matter if we build&run a split AAB directly to device or via Play Console.

@Weimmer
Copy link

Weimmer commented Feb 25, 2022

Hi I think I have same issue as yours. When build the apk from unity, it works fine, but once I build the aab file and upload to google play console, it will generate a apk file, but the apk does not work, when the ar session active is, the app crashed...

We do not have problems with AABs per se. Only when they are split. No matter if we build&run a split AAB directly to device or via Play Console.

ok... you app works fine when they are not split? my issue happens when I turn on the ar session... using the unity 2021.2.13 and ar foundation 4.2.2

@msNEOANALOG
Copy link
Author

you app works fine when they are not split?

Yes.

@Weimmer
Copy link

Weimmer commented Feb 25, 2022

you app works fine when they are not split?

Yes.

how do you know that... you can not upload the aab file bigger than 150 MB and that is the reason why you split it. I mean my app works fine when it not uploaded.

@msNEOANALOG
Copy link
Author

how do you know that... you can not upload the aab file bigger than 150 MB and that is the reason why you split it. I mean my app works fine when it not uploaded.

I tried it with the ARFroundation example from Unity. It is split, but small. Didn't work. The scene is fixed to the camera.

@Weimmer
Copy link

Weimmer commented Feb 25, 2022

how do you know that... you can not upload the aab file bigger than 150 MB and that is the reason why you split it. I mean my app works fine when it not uploaded.

I tried it with the ARFroundation example from Unity. It is split, but small. Didn't work. The scene is fixed to the camera.

So you mean the ar-foundation exsample aab file can be uploaded, and the apk from google play console works even the ar-foundation exsample was not splited

@Weimmer
Copy link

Weimmer commented Feb 25, 2022

because I even tried with blank scene, only ar session and ar session origin, it crashed same...

@msNEOANALOG
Copy link
Author

So you mean the ar-foundation exsample aab file can be uploaded, and the apk from google play console works even the ar-foundation exsample was not splited

It works as long as it is not splitted. Wether it's an APK or an AAB.

@pacolaf
Copy link

pacolaf commented Mar 15, 2022

Same here, with Unity 2021.2.15f1 (macOS). The app runs perfectly in my connected Android device if the split apk option is not selected. But my app is large and it requires to be splitted for release in Google Play. After the split apk option is selected, the app is installed in the device with no errors but the camera tracking doesn't work, the camera is fixed.

The problem occurs in both apk and aab publish options. I also have tried the Google Asset Delivery plugin for Unity with the same result: with Separate APK Base Asset option active fails (camera is fixed) and with this option disabled it works in my device but I cannot publish de aab file because of its size.

This problem doesn't occur with Unity 2021.1.20, my previous version of Unity before updating to 2021.2.X.

iOS (ARKit) version of my app works perfectly.

@ankur-unity
Copy link
Collaborator

This is a known issue. As noted in this thread, the issue only occurs when the app is compiled with "Split Binary" option. The issue occurs because the UnitySubsystemsManifest.json file that's required for AR Input Subsystem always exist in the main APK while it's being searched in the obb at runtime, if the app was compiled with split binary mode.

The progress on a fix can be tracked here:
https://issuetracker.unity3d.com/issues/android-xr-tracking-is-not-working-when-building-app-bundle-with-split-application-binary-enabled

@pacolaf
Copy link

pacolaf commented Mar 15, 2022

This is a known issue. As noted in this thread, the issue only occurs when the app is compiled with "Split Binary" option. The issue occurs because the UnitySubsystemsManifest.json file that's required for AR Input Subsystem always exist in the main APK while it's being searched in the obb at runtime, if the app was compiled with split binary mode.

The progress on a fix can be tracked here: https://issuetracker.unity3d.com/issues/android-xr-tracking-is-not-working-when-building-app-bundle-with-split-application-binary-enabled

Thanks for the information! I just installed version 2021.2.4f1 and it works. I will keep on using this version until the issue is fixed.

@ankur-unity ankur-unity added bug A bug in an ARFoundation-related package fixpending and removed how to Explains how to accomplish something labels Apr 5, 2022
@pacolaf
Copy link

pacolaf commented May 10, 2022

This issue is finally fixed in 2021.3.2f1. I have tested it and it works fine.

@ankur-unity ankur-unity added fixed Fixed in newer release and removed fixpending labels May 10, 2022
@ankur-unity
Copy link
Collaborator

The issue has been fixed in 2021.3.2f1, 2022.2.0a9, and 2022.2.1f1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in an ARFoundation-related package fixed Fixed in newer release
Projects
None yet
Development

No branches or pull requests

4 participants