首页 > 解决方案 > 应用程序无法在 android 9 版本中运行,但在以下版本中运行

问题描述

我已经构建了从 API 获取数据的新闻应用程序,并且我使用 listView 来显示列表。它在低于 android 9 版本中运行良好,但列表未在 Android 9 中显示。

以下是 Logcat 信息。

2020-03-28 14:06:57.733 2970-2970/com.example.newsfeed I/Zygote: seccomp disabled by setenforce 0
2020-03-28 14:06:57.735 2970-2970/com.example.newsfeed I/xample.newsfee: Late-enabling -Xcheck:jni
2020-03-28 14:06:57.841 2970-2970/com.example.newsfeed W/xample.newsfee: Unexpected CPU variant for X86 using defaults: x86
2020-03-28 14:06:58.450 2970-3001/com.example.newsfeed D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
2020-03-28 14:06:58.449 2970-2970/com.example.newsfeed I/com.example.newsfeed: type=1400 audit(0.0:863): avc: denied { write } for comm=45474C20496E6974 name="property_service" dev="tmpfs" ino=1139 scontext=u:r:untrusted_app:s0:c70,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=1
2020-03-28 14:06:58.449 2970-2970/com.example.newsfeed I/com.example.newsfeed: type=1400 audit(0.0:864): avc: denied { connectto } for comm=45474C20496E6974 path="/dev/socket/property_service" scontext=u:r:untrusted_app:s0:c70,c256,c512,c768 tcontext=u:r:init:s0 tclass=unix_stream_socket permissive=1
2020-03-28 14:06:58.454 2970-3001/com.example.newsfeed D/vndksupport: Loading /vendor/lib/egl/libGLES_emulation.so from current namespace instead of sphal namespace.
2020-03-28 14:06:58.484 2970-3001/com.example.newsfeed E/libEGL: load_driver(/vendor/lib/egl/libGLES_emulation.so): dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so" not found
2020-03-28 14:06:58.485 2970-3001/com.example.newsfeed D/vndksupport: Loading /vendor/lib/egl/libEGL_emulation.so from current namespace instead of sphal namespace.
2020-03-28 14:06:58.541 2970-3001/com.example.newsfeed D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
2020-03-28 14:06:58.542 2970-3001/com.example.newsfeed D/vndksupport: Loading /vendor/lib/egl/libGLESv1_CM_emulation.so from current namespace instead of sphal namespace.
2020-03-28 14:06:58.578 2970-3001/com.example.newsfeed D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
2020-03-28 14:06:58.599 2970-3001/com.example.newsfeed D/vndksupport: Loading /vendor/lib/egl/libGLESv2_emulation.so from current namespace instead of sphal namespace.
2020-03-28 14:06:58.609 2970-3001/com.example.newsfeed D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
2020-03-28 14:06:58.656 2970-2970/com.example.newsfeed W/xample.newsfee: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
2020-03-28 14:06:58.656 2970-2970/com.example.newsfeed W/xample.newsfee: Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
2020-03-28 14:06:58.656 2970-2970/com.example.newsfeed W/xample.newsfee: Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
2020-03-28 14:06:58.656 2970-2970/com.example.newsfeed W/xample.newsfee: Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
2020-03-28 14:06:58.656 2970-2970/com.example.newsfeed W/xample.newsfee: Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
2020-03-28 14:06:58.732 2970-2970/com.example.newsfeed W/xample.newsfee: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
2020-03-28 14:06:58.733 2970-2970/com.example.newsfeed W/xample.newsfee: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
2020-03-28 14:06:58.738 2970-2970/com.example.newsfeed W/xample.newsfee: Accessing hidden method Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic; (light greylist, linking)
2020-03-28 14:06:58.770 2970-2970/com.example.newsfeed E/MainActivity: Main Activity loaded
2020-03-28 14:06:58.789 2970-2970/com.example.newsfeed D/OpenGLRenderer: Skia GL Pipeline
2020-03-28 14:06:58.827 2970-3002/com.example.newsfeed D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-03-28 14:06:58.831 2970-3002/com.example.newsfeed W/xample.newsfee: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, reflection)
2020-03-28 14:06:58.831 2970-3002/com.example.newsfeed W/xample.newsfee: Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, reflection)
2020-03-28 14:06:58.831 2970-3002/com.example.newsfeed W/xample.newsfee: Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (light greylist, reflection)
2020-03-28 14:06:58.853 2970-2970/com.example.newsfeed I/RenderThread: type=1400 audit(0.0:868): avc: denied { connectto } for path=006C6F63616C5F6F70656E676C scontext=u:r:untrusted_app:s0:c70,c256,c512,c768 tcontext=u:r:local_opengl:s0 tclass=unix_stream_socket permissive=1
2020-03-28 14:06:58.918 2970-3004/com.example.newsfeed I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-03-28 14:06:58.918 2970-3004/com.example.newsfeed I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2020-03-28 14:06:58.918 2970-3004/com.example.newsfeed I/OpenGLRenderer: Initialized EGL, version 1.4
2020-03-28 14:06:58.918 2970-3004/com.example.newsfeed D/OpenGLRenderer: Swap behavior 1
2020-03-28 14:06:58.935 2970-3004/com.example.newsfeed D/EGL_emulation: eglCreateContext: 0xec44dca0: maj 2 min 0 rcv 2
2020-03-28 14:06:59.054 2970-3004/com.example.newsfeed D/vndksupport: Loading /vendor/lib/hw/android.hardware.graphics.mapper@2.0-impl.so from current namespace instead of sphal namespace.
2020-03-28 14:06:59.055 2970-3004/com.example.newsfeed D/vndksupport: Loading /vendor/lib/hw/gralloc.vbox86.so from current namespace instead of sphal namespace.
2020-03-28 14:06:59.064 2970-3004/com.example.newsfeed E/EGL_emulation: tid 3004: eglSurfaceAttrib(1354): error 0x3009 (EGL_BAD_MATCH)
2020-03-28 14:06:59.064 2970-3004/com.example.newsfeed W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xec44dbe0, error=EGL_BAD_MATCH
2020-03-28 14:06:59.353 2970-3004/com.example.newsfeed E/EGL_emulation: tid 3004: eglSurfaceAttrib(1354): error 0x3009 (EGL_BAD_MATCH)
2020-03-28 14:06:5

标签: javaandroid

解决方案


你的问题不完整。尽管有各种原因无法从 api 获取数据。如果您正在使用https://XYZ,请android:usesCleartextTraffic="true"在您的清单的应用程序标签中添加。


推荐阅读