lysergic-acid
lysergic-acid

Reputation: 20050

Crash when attempting to show an audience network rewarded video

In our game we are using the Facebook SDK for Unity (v7.5.0), together with rewarded video mediation from IronSource.

The underlying Facebook SDK for Android is v4.11.0.

When attempting to show a rewarded video, our game crashes with this exception:

E/JavaBinder( 1172): !!! FAILED BINDER TRANSACTION !!!  (parcel size = 521496)
W/ActivityManager( 1172): Exception when starting activity com.moonactive.coinmaster/com.facebook.ads.AudienceNetworkActivity
W/ActivityManager( 1172): android.os.TransactionTooLargeException: data parcel size 521496 bytes
W/ActivityManager( 1172):   at android.os.BinderProxy.transactNative(Native Method)
W/ActivityManager( 1172):   at android.os.BinderProxy.transact(Binder.java:503)
W/ActivityManager( 1172):   at android.app.ApplicationThreadProxy.scheduleLaunchActivity(ApplicationThreadNative.java:1088)
W/ActivityManager( 1172):   at com.android.server.am.ActivityStackSupervisor.realStartActivityLocked(ActivityStackSupervisor.java:2540)
W/ActivityManager( 1172):   at com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked(ActivityStackSupervisor.java:2661)
W/ActivityManager( 1172):   at com.android.server.am.ActivityStack.resumeTopActivityInnerLocked(ActivityStack.java:3493)
W/ActivityManager( 1172):   at com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:2613)
W/ActivityManager( 1172):   at com.android.server.am.ActivityStackSupervisor.resumeTopActivitiesLocked(ActivityStackSupervisor.java:5060)
W/ActivityManager( 1172):   at com.android.server.am.ActivityStack.completePauseLocked(ActivityStack.java:1687)
W/ActivityManager( 1172):   at com.android.server.am.ActivityStack.completePauseLocked(ActivityStack.java:1552)
W/ActivityManager( 1172):   at com.android.server.am.ActivityStack.activityPausedLocked(ActivityStack.java:1474)
W/ActivityManager( 1172):   at com.android.server.am.ActivityManagerService.activityPaused(ActivityManagerService.java:10204)
W/ActivityManager( 1172):   at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:547)
W/ActivityManager( 1172):   at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:4014)
W/ActivityManager( 1172):   at android.os.Binder.execTransact(Binder.java:453)
D/ActivityManager( 1172): isAutoRunBlockedApp:: com.moonactive.coinmaster, Auto Run ON
W/ActivityManager( 1172): Force removing ActivityRecord{6a0b73e u0 com.moonactive.coinmaster/com.moon.coinmaster.android.GameActivity t756}: app died, no saved state

Is this a known bug that has been resolved? I could not find any bugs similar to this.

Upvotes: 0

Views: 1393

Answers (1)

drewster
drewster

Reputation: 6090

Android SDK target 26+ has changed the way activities can pass data around -- basically they limited the amount of data that can be passed.

Eventually Facebook will release an updated AudienceNetwork.aar file to resolve this issue.

However, the workaround is as follows:

Unity automatically builds your Android project targeting the latest and greatest SDK available. Most likely this is SDK 26 at this point. There is no option in the Unity Editor to override this setting, but there IS an option to override the Minimum SDK Version.

  1. Open your Unity project
  2. Go to File -> Build Settings. Make sure 'Android' is selected.
  3. Click Player Settings, then on the right, click to expand Other Settings.
  4. Take note of the "Minimum API Level". There will be some text and a number, like Android 4.1 'Jelly Bean' (API level 16). The number you want, in my example, is the 16.
  5. Save and close your project.
  6. Navigate to the root of your Unity project, then navigate to the Assets/Plugins/Android folder.
  7. Edit the AndroidManifest.xml file there.

    The first line should start out: <?xml ...

    The second line should be something like <manifest xmlns:android...

    Insert THIS line as the 3rd line:

    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />

    Replace the "16" with whatever minimum Sdk version you want, from Step 4 above. Set the targetSdkVersion to 25, or 24, or whatever number you want -- it must be lower than 26.

  8. Delete the Temp folder from your Unity project root.
  9. Open Unity and rebuild your project.

If you're not on Unity, then just update your targetSdkVersion to 25 or lower -- updating the AndroidManifest.xml in your main project folder. As of this morning, Facebook's latest still shows 4.25.0 and still does not work if you target Android SDK 26.

Upvotes: 2

Related Questions