question

mirko avatar image
mirko asked

Playfab Party on android crashes on app start-up.

Hello there,

I installed playfab-party.1.5.0.1-main.0-10.5.2020-preview.unitypackage from official Github site. I have installed other extensions and logged in into title over Playfab Extensions in Unity. I tested it locally, remote and over steam, and SDK works just fine. Problem is android, when I build the game and run it after going over splash screen it just shuts down. There are no any useful information in log (since game goes on pause), I just know Playfab Multiplayer Manager is responsible for this. _Initialize() function in script executes normaly but then somewhere later error happens. Im using unity 2019.4.12f1 and sdk version is "2.97.201014". Thanks in advance for help!

unity3dentitiesmultiplayerandroid
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Thanks for reporting. After researching, we found the following error caused the application’s crash.

AndroidRuntime java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/OkHttpClient$Builder;

The workaround to fix this error is to add the custom gradle template file to the Unity Project before you build the APK. You can refer to the Unity official documentation Gradle for Android to create the template gradle file. Then you can modify the template like the following. In our testing, adding this gradle can solve the crash issue.

......dependencies {......  implementation
'com.squareup.okhttp3:okhttp:4.0.0-alpha02'**DEPS**}......
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dawid Burek avatar image Dawid Burek commented ·

Is this issue resolved in newer versions? I have the same problem.

0 Likes 0 ·
Dawid Burek avatar image Dawid Burek commented ·

Actually it seems that enabling Custom Main Gradle Template with default template autogenerated by Unity does the job, as it already includes missing lib:

   implementation 'com.squareup.okhttp3:okhttp:3.10.0'

To enable custom gradle template, open Project Settings, select Player tab and then navigate to Publish Settings section.


0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.