ISNIT0 / zipternet

1 stars 0 forks source link

Fix compatibility warnings reported in pre-launch report #7

Open julianharty opened 5 years ago

julianharty commented 5 years ago

With version 6 of the app, the pre-launch report has 11 warnings about possible future incompatibilities. These might be for libraries that are included in the app rather than in our code.

10 of the 11 all have the line app.zimternet.traveleurope.MainActivity.onCreate(MainActivity.kt:47)

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredMethodInternal(Native Method)
    at java.lang.Class.getMethod(Class.java:2064)
    at java.lang.Class.getDeclaredMethod(Class.java:2047)
    at android.support.v7.widget.ViewUtils.<clinit>(ViewUtils.java:44)
    at android.support.v7.widget.ViewUtils.makeOptionalFitsSystemWindows(Unknown Source:0)
    at android.support.v7.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:685)
    at android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518)
    at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:466)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
    at app.zimternet.traveleurope.MainActivity.onCreate(MainActivity.kt:47)
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredMethodInternal(Native Method)
    at java.lang.Class.getPublicMethodRecursive(Class.java:2075)
    at java.lang.Class.getMethod(Class.java:2063)
    at java.lang.Class.getMethod(Class.java:1690)
    at android.support.v7.widget.ViewUtils.makeOptionalFitsSystemWindows(ViewUtils.java:84)
    at android.support.v7.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:685)
    at android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518)
    at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:466)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
    at app.zimternet.traveleurope.MainActivity.onCreate(MainActivity.kt:47)
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(III)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredMethodInternal(Native Method)
    at java.lang.Class.getPublicMethodRecursive(Class.java:2075)
    at java.lang.Class.getMethod(Class.java:2063)
    at java.lang.Class.getMethod(Class.java:1690)
    at cyw.a(PG:9)
    at cyE.a(PG:12)
    at org.chromium.content.browser.selection.SmartSelectionClient.<init>(PG:5)
    at czl.a(Unknown Source:7)
    at org.chromium.android_webview.AwContents.e(PG:243)
    at org.chromium.android_webview.AwContents.d(PG:210)
    at org.chromium.android_webview.AwContents.<init>(PG:81)
    at vE.run(PG:15)
    at aKc.a(PG:13)
    at aKd.run(Unknown Source:2)
    at org.chromium.base.task.PostTask.b(PG:13)
    at aKc.a(PG:7)
    at com.android.webview.chromium.WebViewChromiumFactoryProvider.b(PG:6)
    at com.android.webview.chromium.WebViewChromium.init(PG:107)
    at android.webkit.WebView.<init>(WebView.java:422)
    at android.webkit.WebView.<init>(WebView.java:348)
    at android.webkit.WebView.<init>(WebView.java:331)
    at android.webkit.WebView.<init>(WebView.java:318)
    at java.lang.reflect.Constructor.newInstance0(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
    at android.view.LayoutInflater.createView(LayoutInflater.java:647)
    at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:720)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
    at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
    at app.zimternet.traveleurope.MainActivity.onCreate(MainActivity.kt:47)

The 11th warning is for:

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/Handler;Landroid/os/UserHandle;)Z
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredMethodInternal(Native Method)
    at java.lang.Class.getMethod(Class.java:2064)
    at java.lang.Class.getDeclaredMethod(Class.java:2047)
    at aMq.a(PG:4)
    at aMK.a(PG:10)
    at aMr.a(PG:50)
    at cvB.<init>(PG:4)
    at cuV.run(PG:9)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.os.HandlerThread.run(HandlerThread.java:65)
julianharty commented 5 years ago

Some pointers to similar problems include: https://stackoverflow.com/questions/52358496/setcontentview-is-using-non-sdk-interface and https://community.kodular.io/t/warnings-from-the-pre-launch-report/28513

The most relevant section seems to be: "It seems that this is related to Support Library: android.support.v7.appcompat (added in version 24.1.0)

see here:" https://developer.android.com/reference/android/support/v7/appcompat/package-summary "

julianharty commented 5 years ago

Seems Google tools are flagging problems in code created by Google engineers (what madness) as we're using the latest release of v7.appcompat (28.0.0) https://developer.android.com/topic/libraries/support-library/revisions#28-0-0

julianharty commented 5 years ago

I've filed a bug on Google for the issue https://issuetracker.google.com/issues/137041600

julianharty commented 5 years ago

See also https://stackoverflow.com/questions/51988819/android-p-api-28-what-does-the-strictmode-policy-violation-smartselectionev