AR Core Crashes apps on Android 14 - needs to specific RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED

Hi there,

I posted a while back about this issue, but it still hasn’t been fixed, so I wanted to mention it here so others can find it more easily, and maybe the right person at Unity will see it. Android 13 introduced an optional flag on receivers for either RECEIVER_EXPORTED / RECEIVER_NOT_EXPORTED. This flag is required on Android 14. Documentation about that:

It seems like the AR Core package isn’t using this flag when it attempts to install Google Play Services for AR on a device that doesn’t have it installed already. This causes the whole app to crash with an error similar to this:

Unable to resume activity

{com.DefaultCompany.Android14ARInstallCrashTest/com.google.ar.core.InstallActivity}

: java.lang.SecurityException: com.DefaultCompany.Android14ARInstallCrashTest: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn’t being registered exclusively for system broadcasts”

Since this flag is only required on Android 14, apps that target Android 13 don’t have this issue (even running on devices with Android 14) - however, Google Play is requiring apps to target Android 14 by the end of August this month, so this won’t be a work-around by then.

Here’s a bug report that I submitted a few months ago for this. It includes a test project and a little more info about the issue: Unity Issue Tracker - [XR][Android] Crash on Android 14 due to ARCore package not specifying one of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED. I’d love for it to get some traction and be fixed in time for Google’s Android 14 requirement.

Also, there’s already a thread about this issue more generally over here unity3d.player error: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified - Unity Engine - Unity Discussions but I wanted to make one here since it’s specific to Unity’s AR packages.

Thanks in advance for any help!

Hi @bbridgesvb ,

Thanks for your post. I went and looked at ARCB-29, and it seems that we are going back and forth with Google on this and haven’t yet reached a resolution.

Unity’s forums are going read-only tomorrow as part of our migration to the Discussions platform, but please feel free to reach back out in Discussions for further updates on this issue. In the meantime, any progress on this will be available on IssueTracker.

We are also experiencing this bug with an AR app built in Unity 2019.4. We can build directly to a local device and it runs. When we build an .aab and publish it through the Play Store, then downloaded it to an Android 14 device it crashes immediately on start apparently with this error:

2024/07/19 11:43:12.341 16972 16972 Fatal DEBUG Abort message: 'No pending exception expected: java.lang.SecurityException: com.our.app: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

Hello, I’ve also had this issue on my app for Android 14 and I investigated on it. I discovered that, in my case, it was not due to AR but from a google plugin. So, I removed the dependencie from my mainTemplate.graddle which is : implementation ‘com.google.android.play:asset-delivery:2.0.0’ to prevent unity to download it from maven.
This plugin is used to allow users to start playing the game during the download. In my case I didn’t test but I hope that it will not affect the google play release.

I think that google is aware about this and I hope they will had a fix to the plugin.

Now, my app doesn’t crash on Android 14 anymore. I hope it could help.

Thanks Davros. I think I saw someone mentioning that in this thread unity3d.player error: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified but it’s a different issue than the one I’m posting about here. I’m able to reproduce this issue in an empty project that doesn’t have com.google.android.play:asset-delivery (no Google packages, no External Dependency Resolver, etc)

For those seeing this issue, can you let us know what version of AR Foundation you are using, and whether updating to the latest version (5.1.5) resolves it?

Hi! I was experiencing this issue in 5.1.2 (per the listed version in bug report Unity Issue Tracker - [XR][Android] Crash on Android 14 due to ARCore package not specifying one of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED ). I haven’t tested on future versions yet because that issue tracker still says it’s Under Consideration - I’ll let you know if I get a chance to test on 5.1.5.

After talking with Google this should have been resolved when we updated the ARCore SDK we build against, which we did in 5.1.4

That’s fantastic news, thanks CiaranWills! I’ll try updating soon and let you know if I see the issue resolved/unresolved. Thanks again!

Hi, @bbridgesv, did you get any result?

Hi makaka-org, yes! This now seems fixed! My QA Tester just closed the story yesterday. I’ll let you know if I have any more issues after release, but our app is no longer crashing on our Android 14 devices, and are getting prompted to install Google Play Services for AR :smiley: