Android P API Compatibility
See original GitHub issueI installed my app on Android P, there was a dialog showing “Detected problems with API compatibility (visit g.co/dev/appcompat for more info)” every time i launched my app. I enabled the new StrictMode feature and I got the stack trace:
09-18 14:42:15.389 27929-27929/com.xxx.xxx D/StrictMode: StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe;
at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
at java.lang.Class.getDeclaredField(Native Method)
at com.google.gson.internal.UnsafeAllocator.create(UnsafeAllocator.java:41)
at com.google.gson.internal.ConstructorConstructor$14.<init>(ConstructorConstructor.java:221)
at com.google.gson.internal.ConstructorConstructor.newUnsafeAllocator(ConstructorConstructor.java:220)
at com.google.gson.internal.ConstructorConstructor.get(ConstructorConstructor.java:96)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:101)
at com.google.gson.Gson.getAdapter(Gson.java:457)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53)
at com.google.gson.Gson.getAdapter(Gson.java:457)
at retrofit2.converter.gson.GsonConverterFactory.responseBodyConverter(GsonConverterFactory.java:63)
at retrofit2.Retrofit.nextResponseBodyConverter(Retrofit.java:330)
at retrofit2.Retrofit.responseBodyConverter(Retrofit.java:313)
at retrofit2.ServiceMethod$Builder.createResponseConverter(ServiceMethod.java:739)
at retrofit2.ServiceMethod$Builder.build(ServiceMethod.java:172)
at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:170)
at retrofit2.Retrofit$1.invoke(Retrofit.java:147)
at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
So there is any solution or workaround not to reflect system non-open api?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:30
- Comments:8
Top Results From Across the Web
Device compatibility overview - Android Developers
Each successive version of Android provides compatibility for apps that were built using the APIs from previous platform versions, so your app should...
Read more ><uses-sdk> | Android Developers
Lets you express an application's compatibility with one or more versions of the Android platform, by means of an API Level integer.
Read more >Compatibility framework changes (Android 11)
This page describes each app-impacting behavior change that was added to the compatibility framework in Android 11 (API level 30).
Read more >Meet Google Play's target API level requirement
New apps must target Android 12 (API level 31) or higher; except for Wear OS apps, which must target Android 11 (API level...
Read more >SDK Platform release notes - Android Developers
This page provides release information about the SDK packages available for download from the SDK Manager, in the SDK Platforms tab.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm this is in latest version 2.8.5
This warning also appears in Google Play Developer console under compatibility issues.
This is still in the latest version 2.8.6, and is still appearing as a warning on the Google Play Developer console.