question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android P API Compatibility

See original GitHub issue

I 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:open
  • Created 5 years ago
  • Reactions:30
  • Comments:8

github_iconTop GitHub Comments

23reactions
ChristopheVersieuxcommented, May 8, 2019

I can confirm this is in latest version 2.8.5

This warning also appears in Google Play Developer console under compatibility issues.

10reactions
davidoakleycommented, Nov 1, 2019

This is still in the latest version 2.8.6, and is still appearing as a warning on the Google Play Developer console.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found