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

Amplitude SDK 1.1.0. Crush on Android 4.4.4 #35

Closed
N0lex opened this issue Apr 28, 2020 · 6 comments
Closed

Amplitude SDK 1.1.0. Crush on Android 4.4.4 #35

N0lex opened this issue Apr 28, 2020 · 6 comments

Comments

@N0lex
Copy link

N0lex commented Apr 28, 2020

The latest version of Amplitude SDK 1.1.0 (April 5, 2020) does not work on Android 4.4.4.

Crash Log:

E/AndroidRuntime(22109): FATAL EXCEPTION: logThread
E/AndroidRuntime(22109): Process: com.game, PID: 22109
E/AndroidRuntime(22109): java.lang.Error: FATAL EXCEPTION [logThread]
E/AndroidRuntime(22109): Unity version : 2019.2.12f1
E/AndroidRuntime(22109): Device model : asus Nexus 7
E/AndroidRuntime(22109): Device fingerprint: google/nakasi/grouper:4.4.4/KTU84P/1227136:user/release-keys
E/AndroidRuntime(22109): Caused by: java.lang.ExceptionInInitializerError
E/AndroidRuntime(22109): at okhttp3.internal.platform.Platform$Companion.findPlatform(Platform.kt:211)
E/AndroidRuntime(22109): at okhttp3.internal.platform.Platform$Companion.access$findPlatform(Platform.kt:179)
E/AndroidRuntime(22109): at okhttp3.internal.platform.Platform.(Platform.kt:180)
E/AndroidRuntime(22109): at okhttp3.OkHttpClient.(OkHttpClient.kt:219)
E/AndroidRuntime(22109): at okhttp3.OkHttpClient.(OkHttpClient.kt:211)
E/AndroidRuntime(22109): at com.amplitude.api.AmplitudeClient.lambda$initialize$0$AmplitudeClient(AmplitudeClient.java:271)
E/AndroidRuntime(22109): at com.amplitude.api.-$$Lambda$AmplitudeClient$9hxT9i3yp7eOymOvTMj42XcPKBs.run(lambda)
E/AndroidRuntime(22109): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime(22109): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(22109): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(22109): at android.os.HandlerThread.run(HandlerThread.java:61)
E/AndroidRuntime(22109): Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
E/AndroidRuntime(22109): at okhttp3.internal.platform.AndroidPlatform.(AndroidPlatform.kt:232)
E/AndroidRuntime(22109): ... 11 more

Please fix!!!

2019.2.12f1
Nexus 7 2012
Windows 10.

@haoliu-amp
Copy link
Contributor

Look like an error from okhttp.
May I know which okhttp version are you using?

@N0lex
Copy link
Author

N0lex commented Apr 28, 2020

@haoliu-amp Please download Amplitude SDK 1.1.0 and you can see the okhttp version.
Link: 0881abc

amplitude_import_sdk

@haoliu-amp
Copy link
Contributor

Amplitude SDK depends on okhttp library. The old SDK is the one using a very old version of okhttp 3.10.0.

Since Amplitude Unity SDK 1.0.0, we updated the okhttp to be 4.2.2, since it fixed a lot vulnerabilities.

However, okhttp dropped the support for < 5.0 since 3.13.
Please read this. https://developer.squareup.com/blog/okhttp-3-13-requires-android-5/

But you can still use the new SDK with older version okhttp if you wanna get KitKat supported.

How to do it -

If you import library by copying the jar file, you can downgrade okhttp library by replacing it with a version < 3.13.
If you use google dependency resolver, update the dependency version for okhttp in *Dependency.xml file.

@N0lex
Copy link
Author

N0lex commented May 1, 2020

Why is this information missing from the documentation?

Please update your guide:
https://help.amplitude.com/hc/en-us/articles/115002991968-Unity-Plugin-Installation

@haoliu-amp
Copy link
Contributor

We will do it. Thanks for your feedback!

@haoliu-amp
Copy link
Contributor

@N0lex We've updated it. https://help.amplitude.com/hc/en-us/articles/115002991968-Unity-Plugin-Installation#running-on-api-19-20-kitkat

Let me know if the issue is solved! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants