Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27722] Android: V8 warnings in latest master

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionWon't Fix
Resolution Date2020-01-31T00:51:23.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterHans Knöchel
AssigneeUnknown
Created2020-01-20T14:54:28.000+0000
Updated2020-01-31T00:51:23.000+0000

Description

[WARN]  W/com.appc.test: Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
[WARN]  W/com.appc.test: Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
[DEBUG] EGL_emulation: eglMakeCurrent: 0xd5a1aa80: ver 3 0 (tinfo 0xbc082370)
[INFO]  chatty: uid=10133(com.appc.test) RenderThread identical 3 lines
[DEBUG] EGL_emulation: eglMakeCurrent: 0xd5a1aa80: ver 3 0 (tinfo 0xbc082370)
[WARN]  W/com.appc.test: Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
[DEBUG] EGL_emulation: eglMakeCurrent: 0xd5a1aa80: ver 3 0 (tinfo 0xbc082370)
[INFO]  chatty: uid=10133(com.appc.test) RenderThread identical 22 lines
[DEBUG] EGL_emulation: eglMakeCurrent: 0xd5a1aa80: ver 3 0 (tinfo 0xbc082370)
[WARN]  W/com.appc.test: Accessing hidden field Ljava/nio/Buffer;->position:I (greylist, JNI, allowed)
[WARN]  W/com.appc.test: Accessing hidden field Ljava/nio/Buffer;->limit:I (greylist, JNI, allowed)
[WARN]  W/com.appc.test: Accessing hidden field Ljava/nio/Buffer;->_elementSizeShift:I (greylist, JNI, allowed)
[DEBUG] EGL_emulation: eglMakeCurrent: 0xd5a1aa80: ver 3 0 (tinfo 0xbc082370)
[INFO]  chatty: uid=10133(com.appc.test) RenderThread identical 154 lines
[DEBUG] EGL_emulation: eglMakeCurrent: 0xd5a1aa80: ver 3 0 (tinfo 0xbc082370)
[WARN]  W/com.appc.test: Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
Reproducible on our app (available to the team) using latest 9.0.0 master.

Comments

  1. Joshua Quick 2020-01-30

    [~hknoechel], us migrating the Google Support libraries to AndroidX got rid of a bunch of these. In my test app, I'm seeing the following...
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/content/res/Resources;->getCompatibilityInfo()Landroid/content/res/CompatibilityInfo; (light greylist, reflection)
       [WARN]  W/tor.kitchensin: Accessing hidden field Landroid/content/res/CompatibilityInfo;->applicationScale:F (light greylist, reflection)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
       [WARN]  W/tor.kitchensin: Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
       [WARN]  W/tor.kitchensin: Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
       [WARN]  W/tor.kitchensin: Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
       [WARN]  W/tor.kitchensin: Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic; (light greylist, linking)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
       
    The only private method Titanium is accessing is getCompatibilityInfo() here... [TiPlatformHelper.java](https://github.com/appcelerator/titanium_mobile/blob/c27b90877bf41311d74339905aff240b46febe20/android/titanium/src/java/org/appcelerator/titanium/util/TiPlatformHelper.java#L67) Many of the hidden API warnings are coming from Google's AndroidX libraries. There is an open ticket on Google's end here... https://issuetracker.google.com/issues/123699881#comment12 AndroidX is calling hidden computeFitSystemWindows() and makeOptionalFitsSystemWindows() methods via reflection here... [AndroidX ViewUtils.java](https://github.com/aosp-mirror/platform_frameworks_support/blob/a9ac247af2afd4115c3eb6d16c05bc92737d6305/v7/appcompat/src/main/java/androidx/appcompat/widget/ViewUtils.java) AndroidX is calling hidden getTextDirectionHeuristic() method via reflection here... [AndroidX AppCompatTextViewAutoSizeHelper.java](https://github.com/aosp-mirror/platform_frameworks_support/blob/a9ac247af2afd4115c3eb6d16c05bc92737d6305/v7/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeHelper.java#L712) AndroidX is calling hidden getOpticalInsets() method via reflection here... [AndroidX DrawableUtils.java](https://github.com/aosp-mirror/platform_frameworks_support/blob/a9ac247af2afd4115c3eb6d16c05bc92737d6305/v7/appcompat/src/main/java/androidx/appcompat/widget/DrawableUtils.java#L76) The following hidden API warnings are coming from Google's WebView. We can't do anything about it. https://stackoverflow.com/questions/51988819/android-p-api-28-what-does-the-strictmode-policy-violation-smartselectionev
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;-><init>(Landroid/content/Context;I)V (light greylist, reflection)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;->logEvent(Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;)V (light greylist, reflection)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionStarted(I)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(II)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextSelection;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(III)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(IIILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
       
    The following sun/misc/Unsafe hidden API warnings you are seeing comes from the AndroidX version of Google Maps. I can see it in their code here... [AndroidX CodedOutputStream.java](https://github.com/aosp-mirror/platform_external_protobuf/blob/f86b2973c1f2994a879544c60304f2a34b34e92c/java/core/src/main/java/com/google/protobuf/CodedOutputStream.java)
       [WARN]  W/lerator.testin: Accessing hidden method Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (greylist,core-platform-api, reflection, allowed)
       [WARN]  W/lerator.testin: Accessing hidden method Lsun/misc/Unsafe;->arrayIndexScale(Ljava/lang/Class;)I (greylist, reflection, allowed)
       [WARN]  W/lerator.testin: Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, reflection, allowed)
       [WARN]  W/lerator.testin: Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, reflection, allowed)
       [WARN]  W/lerator.testin: Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
       
  2. Joshua Quick 2020-01-30

    *Bottom Line:* The only hidden API warning message Titanium is guilty of is the below, which comes from our [TiPlatformHelper.java](https://github.com/appcelerator/titanium_mobile/blob/c27b90877bf41311d74339905aff240b46febe20/android/titanium/src/java/org/appcelerator/titanium/util/TiPlatformHelper.java#L67) source file.
       [WARN]  W/tor.kitchensin: Accessing hidden method Landroid/content/res/Resources;->getCompatibilityInfo()Landroid/content/res/CompatibilityInfo; (light greylist, reflection)
       
    I'm not sure what we can do about the warnings coming from Google's end... other than to hope they'll resolve them in their newest libraries.
  3. Hans Knöchel 2020-01-30

    Thanks! This can be resolved as wont fix then (and maybe fix the one issue).
  4. Joshua Quick 2020-01-31

    I wrote up Titanium's hidden API issue here: [TIMOB-27743] Thanks for bringing this up [~hknoechel]. I'm sure this will come up as a tech-support issue later, so, this ticket will be a good reference.

JSON Source