ERROR: Unknown bits set in runtime_flags: 0x8000

ERROR: Unknown bits set in runtime_flags: 0x8000

扫描 Wi-Fi 网络的简单应用程序。

这个供参考:Get available wi-fi scan result in customized listview

只需将 ListView 放入布局中,然后将 ACCESS/CHANGE_WIFI_STATE 权限添加到清单中。

问题是它适用于我的三星 J3 (2016),但我不知道为什么它不适用于我的新三星 M11。与 Android 版本有关吗?我已经退回了有同样问题的 Realme C3,因为我认为这是由于 Mediatek SOC。

三星 M11(Android10)日志:

03/28 20:09:56: Launching 'app' on Physical Device.
Install successfully finished in 3 s 220 ms.
$ adb shell am start -n "es.josecarlos.myapplication/es.josecarlos.myapplication.SearchWifi" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 29558 on device 'samsung-sm_m115f-R9JR30FM7HJ'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/s.myapplicatio: Late-enabling -Xcheck:jni
E/s.myapplicatio: Unknown bits set in runtime_flags: 0x8000
D/ActivityThread: setConscryptValidator
D/ActivityThread: setConscryptValidator - put
E/ANDR-PERF: IPerf:: Perf HAL Service is not available.
E/ANDR-PERF: IPerf:: Perf HAL Service is not available.
E/ANDR-PERF: IPerf:: Perf HAL Service is not available.
I/Perf: Connecting to perf service.
I/s.myapplicatio: Starting a blocking GC Alloc
    Starting a blocking GC Alloc
I/s.myapplicatio: Waiting for a blocking GC Alloc
I/s.myapplicatio: WaitForGcToComplete blocked Alloc on ClassLinker for 20.796ms
    Starting a blocking GC Alloc
D/PhoneWindow: forceLight changed to true [] from com.android.internal.policy.PhoneWindow.updateForceLightNavigationBar:4238 com.android.internal.policy.DecorView.updateColorViews:1490 com.android.internal.policy.PhoneWindow.dispatchWindowAttributesChanged:3216 android.view.Window.setFlags:1148 com.android.internal.policy.PhoneWindow.generateLayout:2444 
I/MultiWindowDecorSupport: updateCaptionType >> DecorView@9ffef9d[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
D/MultiWindowDecorSupport: setCaptionType = 0, DecorView = DecorView@9ffef9d[]
W/s.myapplicatio: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/s.myapplicatio: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
D/ViewRootImpl@73bc89c[SearchWifi]: setView = com.android.internal.policy.DecorView@9ffef9d TM=true MM=false
D/ViewRootImpl@73bc89c[SearchWifi]: Relayout returned: old=(0,0,720,1560) new=(0,0,720,1560) req=(720,1560)0 dur=14 res=0x7 s={true 3550955520} ch=true
D/OpenGLRenderer: createReliableSurface : 0xd3a8e0c0, 0xd3a74800
I/AdrenoGLES: QUALCOMM build                   : 2ced3f2, Id01cc02572
    Build Date                       : 12/15/19
    OpenGL ES Shader Compiler Version: EV031.27.05.02
    Local Branch                     : 
    Remote Branch                    : refs/tags/AU_LINUX_ANDROID_LA.UM.8.6.2.R1.10.00.00.537.049
    Remote Branch                    : NONE
    Reconstruct Branch               : NOTHING
    Build Config                     : S L 8.0.10 AArch32
D/AbsListView:  in onLayout changed 
I/AdrenoGLES: PFP: 0x005ff112, ME: 0x005ff066
W/Gralloc3: mapper 3.x is not supported
D/ViewRootImpl@73bc89c[SearchWifi]: MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager: prepareNavigationBarInfo() DecorView@9ffef9d[SearchWifi]
    getNavigationBarColor() -855310
D/InputMethodManager: prepareNavigationBarInfo() DecorView@9ffef9d[SearchWifi]
    getNavigationBarColor() -855310
V/InputMethodManager: Starting input: tba=es.josecarlos.myapplication ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager: startInputInner - Id : 0
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/ViewRootImpl@73bc89c[SearchWifi]: MSG_RESIZED: frame=(0,0,720,1560) ci=(0,65,0,84) vi=(0,65,0,84) or=1
D/InputMethodManager: prepareNavigationBarInfo() DecorView@9ffef9d[SearchWifi]
D/InputMethodManager: getNavigationBarColor() -855310
V/InputMethodManager: Starting input: tba=es.josecarlos.myapplication ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager: startInputInner - Id : 0
D/ViewRootImpl@73bc89c[SearchWifi]: ViewPostIme pointer 0
D/ViewRootImpl@73bc89c[SearchWifi]: ViewPostIme pointer 1
D/ViewRootImpl@47f6701[Toast]: setView = android.widget.LinearLayout@76759a6 TM=true MM=false
V/Toast: Text: Fsca in android.widget.Toast$TN@b5efe7
D/ViewRootImpl@47f6701[Toast]: Relayout returned: old=(0,65,720,1476) new=(232,1287,488,1364) req=(256,77)0 dur=12 res=0x7 s={true 3550953472} ch=true
D/OpenGLRenderer: createReliableSurface : 0xb8abc140, 0xd3a74000
D/ViewRootImpl@47f6701[Toast]: MSG_RESIZED: frame=(232,1287,488,1364) ci=(0,0,0,0) vi=(0,0,256,77) or=1
D/ViewRootImpl@47f6701[Toast]: dispatchDetachedFromWindow
D/InputTransport: Input channel destroyed: 'c01175c', fd=75

三星 J3 (Android 5.1) 日志:

03/28 20:19:39: Launching 'app' on Physical Device.
Install successfully finished in 1 m 15 s 28 ms.
$ adb shell am start -n "es.josecarlos.myapplication/es.josecarlos.myapplication.SearchWifi" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 8248 on device 'samsung-sm_j320fn-42000d659a379400'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/ResourcesManager: getTopLevelResources: /data/app/es.josecarlos.myapplication-1/base.apk / 1.0 running in es.josecarlos.myapplication rsrc of package es.josecarlos.myapplication
I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=}
D/ResourcesManager: For user 0 new overlays fetched Null
I/InjectionManager: Inside getClassLibPath caller 
D/InjectionManager: InjectionManager
    fillFeatureStoreMap es.josecarlos.myapplication
I/InjectionManager: Constructor es.josecarlos.myapplication, Feature store :{}
    featureStore :{}
W/ResourcesManager: getTopLevelResources: /data/app/es.josecarlos.myapplication-1/base.apk / 1.0 running in es.josecarlos.myapplication rsrc of package es.josecarlos.myapplication
W/ResourcesManager: getTopLevelResources: /data/app/es.josecarlos.myapplication-1/base.apk / 1.0 running in es.josecarlos.myapplication rsrc of package es.josecarlos.myapplication
    getTopLevelResources: /data/app/es.josecarlos.myapplication-1/base.apk / 1.0 running in es.josecarlos.myapplication rsrc of package es.josecarlos.myapplication
D/ResourcesManager: For user 0 new overlays fetched Null
W/ResourceType: Failure getting entry for 0x01080946 (t=7 e=2374) (error -75)
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
D/PhoneWindow: *FMB* installDecor mIsFloating : false
    *FMB* installDecor flags : -2139029248
I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat>
    Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat>
D/TextView: setTypeface with style : 0
D/TextView: setTypeface with style : 0
D/TextView: setTypeface with style : 0
W/ResourceType: Failure getting entry for 0x01080946 (t=7 e=2374) (error -75)
    Failure getting entry for 0x01080946 (t=7 e=2374) (error -75)
D/AbsListView: Get MotionRecognitionManager
E/MotionRecognitionManager: mSContextService = null
    motionService = null
D/Activity: performCreate Call Injection manager
I/InjectionManager: dispatchOnViewCreated > Target : es.josecarlos.myapplication.SearchWifi isFragment :false
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: false
D/PhoneWindow: *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
    *FMB* isFloatingMenuEnabled return false
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Get maximum texture size. GL_MAX_TEXTURE_SIZE is 4096
    Enabling debug mode 0
I/InjectionManager: dispatchCreateOptionsMenu :es.josecarlos.myapplication.SearchWifi
    dispatchPrepareOptionsMenu :es.josecarlos.myapplication.SearchWifi
D/TextView: setTypeface with style : 0
D/TextView: setTypeface with style : 0
D/TextView: setTypeface with style : 0
    setTypeface with style : 0
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@117c6e4b time:365818
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/TextView: setTypeface with style : 0
D/TextView: setTypeface with style : 0
    setTypeface with style : 0
D/TextView: setTypeface with style : 0
D/InputMethodManager: windowDismissed mLockisused = false

已解决。我必须将 FINE_LOCATION 添加到清单中,并且:

  1. 在“设置”中手动授予位置权限。

  1. 制作一个弹出窗口,在用户第一次启动应用程序时询问位置权限。