Building Android bundles breaks features like AR

So I’m finding that if I build an app bundle using Gradle then a load of stuff that works fine in individual apks gets broken. For example Vuforia AR stops detecting AR core being available.

I can build an apk using the internal build system and all checks out fine, ARM64 or ARMv7 or joint doesn’t matter.
I can export a Gradle project and build an apk and that works too.

However in order to publish I’m building signed app bundles and as soon as I do and install via the app store then things stop working, anything that needs a 3rd party library seems to stop functioning.

Is there some trick to building a Gradle project generated from Unity to an app bundle to stop this happening?

Unfortunately building a bundle directly from Unity fails to work so I haven’t been able to test that option.
Everything I tried to fix that has failed.

Did you check the logcat for errors?

Also, what kind of errors you see when exporting app bundle from Unity?

I’m not seeing any errors in the Pre-launch tests. Just 1 warning about APIs

API Ljava/lang/invoke/MethodHandles$Lookup;->(Ljava/lang/Class;I)V

The error I get building from Unity directly is:

…The sticking out tongue emoji’s are now just taunting me :frowning:

Google says, that’s something is locking your cache, search for fileHashes.lock in .gradle\caches\

Try deleting it

Creates a new lock file when I build and then seems to give much the same results

So giving up on bundles until this gets fixed, hopefully Google don’t drop support for apks

Googling “Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory()” from your errors gives me gradle - Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory() - Stack Overflow which says you could be using a wrong java version. Have you followed the setup guide here Unity - Manual: Android environment setup ?

Unfortunately I’m using 2018.3.14 and these are different instructions to those you posted

These are the ones I followed
https://docs.unity3d.com/2018.3/Documentation/Manual/android-sdksetup.html?_ga=2.222488667.1369058017.1570450803-62453373.1568817120

2018.3.14 doesn’t give me the option to install the Android SDK via the hub