Android: Instant app showing just white screen

2019-02-20 08:03发布

问题:

I was trying to make an basic Hello world instant app. For that I am following https://developer.android.com/topic/instant-apps/getting-started/first-instant-app.html

I have set up everything as per the doc, but I am not able to get my app running properly. All I am getting is a white screen

SDK updated

Output

Even I am not getting any thing meaningful from logcat output also

06-29 11:37:14.376 5419-5431/? I/DevAtomProvider: Dev Manager providing jar from /data/user/0/com.google.android.instantapps.devman/cache/iapk_atoms/com.example.myfourthinstantapplication/atom-download--feature-1498716430329/feature.jar
06-29 11:37:14.111 5529-5529/? W/isor.isolated15: type=1400 audit(0.0:26): avc: denied { getattr } for path="/data/data/com.google.android.instantapps.supervisor" dev="dm-0" ino=7647 scontext=u:r:isolated_app:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
06-29 11:37:14.660 5475-5559/? E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
06-29 11:37:14.666 5475-5559/? I/aiagpu: [0629/113714:INFO:gpu_host.cc(46)] [channel = GPU_CHANNEL_1] init


                                         [ 06-29 11:37:14.671  5475: 5559 D/         ]
                                         HostConnection::get() New Host Connection established 0x91f551c0, tid 5559


                                         [ 06-29 11:37:14.675  5475: 5559 W/         ]
                                         Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 
06-29 11:37:14.683 5475-5559/? D/EGL_emulation: eglCreateContext: 0xa2b91dc0: maj 1 min 0 rcv 1
06-29 11:37:14.690 5475-5559/? W/System: ClassLoader referenced unknown path: 
06-29 11:37:14.715 5475-5475/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
06-29 11:37:14.768 5475-5564/? I/Isotope: UID: [10086]  PID: [5475] HygieneTaskService : Starting task: HygieneTaskService.schedule
06-29 11:37:14.794 5475-5564/? W/InstanceID/Rpc: Found 10013
06-29 11:37:14.939 5529-5540/? V/native: jni_stub.cpp:24 Read:32 from instant_app_interface_fd
06-29 11:37:14.939 5529-5540/? V/native: jni_stub.cpp:42 Read function ptr : 1
06-29 11:37:14.939 5529-5540/? D/native: jni_stub.cpp:63 Registering com/google/android/instantapps/supervisor/gpu/GpuClientCreatorNativeImpl 0xa5735904 2
06-29 11:37:14.939 5529-5540/? D/native: jni_stub.cpp:63 Registering com/google/android/instantapps/supervisor/gpu/WindowContainerNativeImpl 0xa573591c 2
06-29 11:37:14.939 5529-5540/? D/native: jni_stub.cpp:63 Registering com/google/android/instantapps/supervisor/gpu/WindowBufferContainerNativeImpl 0xa5735934 2
06-29 11:37:14.940 5529-5540/? D/native: jni_stub.cpp:63 Registering com/google/android/instantapps/supervisor/syscall/SyscallServiceClient 0xa5735a00 6
06-29 11:37:14.940 5529-5540/? D/native: jni_stub.cpp:63 Registering com/google/android/instantapps/supervisor/syscall/IPCNative 0xa5737a34 1
06-29 11:37:14.940 5529-5540/? D/native: jni_stub.cpp:63 Registering com/google/android/instantapps/supervisor/syscall/SyscallService 0xa57359a0 6
06-29 11:37:14.940 5529-5540/? D/native: jni_stub.cpp:63 Registering com/google/android/instantapps/supervisor/syscall/NativeLogSettings 0xa5735a60 6
06-29 11:37:14.940 5529-5540/? D/native: jni_stub.cpp:63 Registering com/google/android/instantapps/supervisor/gpu/GpuHostCreatorNativeImpl 0xa57358e0 3
06-29 11:37:14.940 5529-5540/? D/native: jni_stub.cpp:63 Registering com/google/android/instantapps/supervisor/syscall/LibraryLoader 0xa57359e8 1
06-29 11:37:15.345 5475-5559/? W/Isotope: UID: [10086]  PID: [5475] ServiceMgrForwarder : Service not found: dropbox
06-29 11:37:15.347 5475-5559/? W/Isotope: UID: [10086]  PID: [5475] ServiceMgrForwarder : Service not found: graphicsstats
06-29 11:37:15.363 5475-5559/? W/Isotope: UID: [10086]  PID: [5475] ServiceMgrForwarder : Service not found: overlay
06-29 11:37:15.553 5529-5567/? D/SyscallServiceClient: Syscall client initialized
06-29 11:37:15.562 5529-5540/? I/aiagpu: [0629/113715:INFO:gpu_client.cc(55)] GpuClient::Initialize
06-29 11:37:15.606 5475-5555/? I/IsotopeNative: storage_manager.cpp:171 [StorageManager]: calling uid 99002 with package name com.example.myfourthinstantapplication cannot access /data/user wrt root directory /data/data/com.google.android.instantapps.supervisor/files
06-29 11:37:15.606 5475-5555/? I/IsotopeNative: storage_manager.cpp:171 [StorageManager]: calling uid 99002 with package name com.example.myfourthinstantapplication cannot access /data/user wrt root directory /data/data/com.google.android.instantapps.supervisor/files
06-29 11:37:15.606 5475-5555/? I/IsotopeNative: storage_manager.cpp:171 [StorageManager]: calling uid 99002 with package name com.example.myfourthinstantapplication cannot access /data/user wrt root directory /data/data/com.google.android.instantapps.supervisor/files
06-29 11:37:15.607 5475-5555/? I/IsotopeNative: storage_manager.cpp:171 [StorageManager]: calling uid 99002 with package name com.example.myfourthinstantapplication cannot access /data/user wrt root directory /data/data/com.google.android.instantapps.supervisor/files
06-29 11:37:15.607 5475-5555/? I/IsotopeNative: storage_manager.cpp:171 [StorageManager]: calling uid 99002 with package name com.example.myfourthinstantapplication cannot access /data/user wrt root directory /data/data/com.google.android.instantapps.supervisor/files
06-29 11:37:15.607 5475-5555/? I/IsotopeNative: storage_manager.cpp:171 [StorageManager]: calling uid 99002 with package name com.example.myfourthinstantapplication cannot access /data/user wrt root directory /data/data/com.google.android.instantapps.supervisor/files
06-29 11:37:15.607 5475-5555/? I/IsotopeNative: storage_manager.cpp:171 [StorageManager]: calling uid 99002 with package name com.example.myfourthinstantapplication cannot access /data/user wrt root directory /data/data/com.google.android.instantapps.supervisor/files
06-29 11:37:18.003 1931-3113/? W/io.grpc.internal.ci: [{0}] Failed to resolve name. status={1}
06-29 11:37:18.051 1550-1584/? I/InputReader: Reconfiguring input devices.  changes=0x00000010
06-29 11:37:18.060 1717-1717/? D/CarrierSvcBindHelper: No carrier app for: 0
06-29 11:37:22.085 2559-2625/? I/Finsky: [150] com.google.android.finsky.g.d.a(24): Completed 0 account content syncs with 0 successful.
06-29 11:37:22.087 2559-2559/? I/Finsky: [1] com.google.android.finsky.services.e.a(5): Installation state replication succeeded.
06-29 11:37:33.022 1313-1335/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 3574921 , only wrote 3574080
06-29 11:37:33.109 1550-1563/? I/ProcessStatsService: Prepared write state in 9ms
06-29 11:37:33.233 5529-5529/? W/art: Attempt to set the sensitive thread twice. Tid:5529
06-29 11:37:33.383 5475-5485/? I/art: Background partial concurrent mark sweep GC freed 19558(1255KB) AllocSpace objects, 8(252KB) LOS objects, 35% free, 7MB/11MB, paused 4.514ms total 155.311ms
06-29 11:37:33.409 1550-1855/? I/ActivityManager: START u0 {dat=https://myfourthinstantapplication.example.com/... flg=0x10000000 cmp=com.google.android.instantapps.supervisor/.shadow.ShadowActivity10 (has extras)} from uid 10086 on display 0
06-29 11:37:33.489 1269-1305/? D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 2691072
06-29 11:37:33.509 1550-1559/? I/art: Background partial concurrent mark sweep GC freed 11387(828KB) AllocSpace objects, 4(208KB) LOS objects, 23% free, 12MB/16MB, paused 2.852ms total 113.459ms
06-29 11:37:33.520 1269-1269/? E/EGL_emulation: tid 1269: eglCreateSyncKHR(1901): error 0x3004 (EGL_BAD_ATTRIBUTE)
06-29 11:37:33.597 1985-2151/? D/EGL_emulation: eglMakeCurrent: 0xb0305480: ver 2 0 (tinfo 0xb03036c0)
06-29 11:37:33.708 1550-1559/? I/art: Background partial concurrent mark sweep GC freed 1008(54KB) AllocSpace objects, 0(0B) LOS objects, 23% free, 13MB/17MB, paused 3.307ms total 152.453ms
06-29 11:37:33.943 1630-1648/? I/art: Background partial concurrent mark sweep GC freed 14682(952KB) AllocSpace objects, 2(132KB) LOS objects, 25% free, 11MB/15MB, paused 2.209ms total 115.433ms
06-29 11:37:33.945 5529-5529/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.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
06-29 11:37:34.586 1269-1274/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
06-29 11:37:34.587 5475-5487/? W/Isotope: UID: [10086]  PID: [5475] ServiceMgrForwarder : Service not found: graphicsstats

                                          [ 06-29 11:37:34.591  5475: 5486 D/         ]
                                          HostConnection::get() New Host Connection established 0x91f18840, tid 5486


                                          [ 06-29 11:37:34.593  5475: 5486 W/         ]
                                          Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 

                                          [ 06-29 11:37:34.623  5529: 5529 D/         ]
                                          HostConnection::get() New Host Connection established 0xa3eb2bc0, tid 5529


                                          [ 06-29 11:37:34.624  5529: 5529 W/         ]
                                          Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 
06-29 11:37:34.736 5529-5579/? D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
06-29 11:37:34.737 5475-5486/? I/IsotopeNative: storage_manager.cpp:171 [StorageManager]: calling uid 99002 with package name com.example.myfourthinstantapplication cannot access /dev/socket/property_service wrt root directory /data/data/com.google.android.instantapps.supervisor/files
06-29 11:37:34.737 5475-5486/? W/IsotopeNative: syscall_server.cpp:737 [SyscallServer]: SyscallServer: accessing path /dev/socket/property_service in 8 which is not allowed! 
06-29 11:37:34.762 5529-5579/? D/libEGL: loaded /system/lib/egl/libGLES_emulation.so
06-29 11:37:34.926 5529-5529/? W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
06-29 11:37:34.977 5529-5579/? I/OpenGLRenderer: Initialized EGL, version 1.4
06-29 11:37:34.977 5529-5579/? D/OpenGLRenderer: Swap behavior 1
06-29 11:37:34.977 5529-5579/? W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
06-29 11:37:34.977 5529-5579/? D/OpenGLRenderer: Swap behavior 0

                                                 [ 06-29 11:37:34.979  5475: 5570 D/         ]
                                                 HostConnection::get() New Host Connection established 0x91f25000, tid 5570


                                                 [ 06-29 11:37:34.983  5475: 5570 W/         ]
                                                 Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 

                                                 [ 06-29 11:37:35.025  5475: 5580 D/         ]
                                                 HostConnection::get() New Host Connection established 0x91f259c0, tid 5580


                                                 [ 06-29 11:37:35.028  5475: 5580 W/         ]
                                                 Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 
06-29 11:37:35.068 5475-5580/? D/EGL_emulation: eglCreateContext: 0xa2bcb900: maj 2 min 0 rcv 2
06-29 11:37:35.072 5475-5580/? D/EGL_emulation: eglMakeCurrent: 0xa2bcb900: ver 2 0 (tinfo 0x905ff620)
06-29 11:37:35.214 5475-5580/? D/EGL_emulation: eglMakeCurrent: 0xa2bcb900: ver 2 0 (tinfo 0x905ff620)
06-29 11:37:35.446 5475-5512/? D/EGL_emulation: eglMakeCurrent: 0xb0305660: ver 2 0 (tinfo 0xb0303700)
06-29 11:37:35.451 1550-1570/? I/ActivityManager: Displayed com.google.android.instantapps.supervisor/.shadow.ShadowActivity10: +2s4ms
06-29 11:37:35.860 1550-1570/? I/WindowManager: Destroying surface Surface(name=com.android.launcher3/com.android.launcher3.Launcher) called by com.android.server.wm.WindowStateAnimator.destroySurface:2014 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:881 com.android.server.wm.WindowState.destroyOrSaveSurface:2073 com.android.server.wm.AppWindowToken.destroySurfaces:363 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.AppWindowAnimator.stepAnimationLocked:427 com.android.server.wm.WindowAnimator.updateAppWindowsLocked:176 com.android.server.wm.WindowAnimator.animateLocked:678 
06-29 11:37:35.889 5475-5475/? D/Supervisor: UrlHandler stopping
06-29 11:37:35.907 1550-1855/? I/ActivityManager: Activity reported stop, but no longer stopping: ActivityRecord{25fc4e u0 com.google.android.instantapps.supervisor/.UrlHandler t29 f}
06-29 11:37:36.262 1313-1336/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 3883444 , only wrote 3729600
06-29 11:37:41.168 1550-2912/? D/ConnectivityService: reportNetworkConnectivity(100, false) by 10013
06-29 11:37:41.193 1550-2016/? I/ActivityManager: Start proc 5588:com.google.android.talk/u0a55 for broadcast com.google.android.talk/com.google.android.apps.hangouts.service.GcmStateReceiver
06-29 11:37:41.198 5588-5588/? W/art: Unexpected CPU variant for X86 using defaults: x86
06-29 11:37:41.201 1550-1571/? W/ProcessCpuTracker: Skipping unknown process pid 5587
06-29 11:37:41.247 5588-5588/? W/System: ClassLoader referenced unknown path: /system/app/Hangouts/lib/x86
06-29 11:37:41.477 5588-5588/? I/Babel_telephony: TeleModule.onApplicationCreate
06-29 11:37:41.494 5588-5611/? I/Babel_SMS: MmsConfig: mnc/mcc: 310/260
06-29 11:37:41.494 5588-5611/? I/Babel_SMS: MmsConfig.loadMmsSettings
06-29 11:37:41.498 5588-5611/? I/Babel_SMS: MmsConfig.loadDeviceMmsSettings from API: mUserAgent=GoldfishNexus, mUaProfUrl=http://gsm.lge.com/html/gsm/Nexus5-M3.xml
06-29 11:37:41.499 5588-5611/? I/Babel_SMS: MmsConfig.loadFromDatabase
06-29 11:37:41.513 5588-5611/? E/SQLiteLog: (1) no such table: mmsconfig
06-29 11:37:41.520 5588-5611/? I/Babel_SMS: MmsConfig: no mmsconfig table android.database.sqlite.SQLiteException: no such table: mmsconfig (code 1): , while compiling: SELECT key, value, type FROM mmsconfig WHERE numeric=?
06-29 11:37:41.520 5588-5611/? I/Babel_SMS: MmsConfig.loadFromResources
06-29 11:37:41.521 5588-5611/? E/Babel_SMS: canonicalizeMccMnc: invalid mccmnc nullnull
06-29 11:37:41.522 5588-5611/? W/Babel_SMS: MmsConfig: invalid key=userAgent or type=string
06-29 11:37:41.522 5588-5611/? W/Babel_SMS: MmsConfig: invalid key=uaProfUrl or type=string
06-29 11:37:41.522 5588-5611/? I/Babel_SMS: MmsConfig.loadMmsSettings: mUserAgent=GoldfishNexus, mUaProfUrl=http://gsm.lge.com/html/gsm/Nexus5-M3.xml
06-29 11:37:41.531 5588-5588/? I/Babel_Prime: wrapCrashReportingIntoUncaughtExceptionHandler
06-29 11:37:41.531 5588-5588/? I/Babel_Prime: isMemoryEnabled=false
06-29 11:37:41.532 5588-5588/? I/Babel_Prime: isTimerEnabled=false
06-29 11:37:41.532 5588-5588/? I/Babel_Prime: isCrashCounterEnabled=true
06-29 11:37:41.552 5588-5588/? I/Babel_Crash: Startup - clean
06-29 11:37:41.591 1550-1598/? D/ConnectivityService: NetworkAgentInfo [MOBILE (LTE) - 100] validation passed
06-29 11:37:41.610 5588-5588/? I/Babel_Prime: startMemoryMonitor
06-29 11:37:41.631 5588-5588/? D/Babel: onCreate: Shutdown runnable posted in onCreate with a delay of 5000 ms.
06-29 11:37:41.783 5588-5588/? V/NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 259 native methods...
06-29 11:37:41.843 5588-5588/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
06-29 11:37:41.850 5588-5588/? I/ProviderInstaller: Installed default security provider GmsCore_OpenSSL
06-29 11:37:41.874 5588-5588/? D/Babel: Idle: Shutdown runnable posted in release with a delay of 5000 ms.
06-29 11:37:46.921 5588-5588/? D/Babel: RefCountedService(com.google.android.apps.hangouts.requestwriter.RequestWriter) onDestroy (count=0, startId=1 stopped=true)
06-29 11:37:46.924 1550-3351/? I/ActivityManager: Killing 4980:com.google.android.talk:matchstick/u0a55 (adj 906): empty #17
06-29 11:37:46.952 1550-2016/? D/ActivityManager: cleanUpApplicationRecord -- 4980
06-29 11:37:47.537 1550-1559/? I/art: Background sticky concurrent mark sweep GC freed 38683(3MB) AllocSpace objects, 6(264KB) LOS objects, 22% free, 13MB/17MB, paused 2.228ms total 225.708ms
06-29 11:37:56.504 5588-5606/? W/Babel: bcq TOOK TOO LONG! (15041ms > 10000ms)
06-29 11:37:56.504 5588-5607/? W/Babel: bcq TOOK TOO LONG! (15026ms > 10000ms)
06-29 11:37:56.525 5627-5627/? W/art: Unexpected CPU variant for X86 using defaults: x86
06-29 11:37:56.526 1550-1563/? I/ActivityManager: Start proc 5627:com.google.android.talk:matchstick/u0a55 for broadcast com.google.android.talk/com.google.android.libraries.matchstick.net.MatchstickInProcessReceiver
06-29 11:37:56.534 1550-1561/? I/Telecom: PhoneAccountRegistrar: SimCallManager queried, returning: null: TSI.gSCM@AHM
06-29 11:37:56.540 5588-5588/? I/Babel_telephony: TeleModule.updateConnectionManagerRegistration, registration preference changed from false to false
06-29 11:37:56.540 5588-5588/? W/Babel: BAM#gBA: invalid account id: -1
06-29 11:37:56.540 5588-5588/? W/Babel: BAM#gBA: invalid account id: -1
06-29 11:37:56.540 5588-5588/? I/Babel_telephony: TeleModule.updateIncomingCallRegistration, preferred account for incoming calls changed from: null to null
06-29 11:37:56.548 1550-2015/? I/Telecom: PhoneAccountRegistrar: SimCallManager queried, returning: null: TSI.gSCM@AHU
06-29 11:37:56.573 5627-5627/? W/System: ClassLoader referenced unknown path: /system/app/Hangouts/lib/x86
06-29 11:37:56.798 5627-5642/? I/MS_RegisterService: RegisterService intent:Intent { act=register_intent_action flg=0x10 cmp=com.google.android.talk/com.google.android.libraries.matchstick.net.SilentRegisterService } isPeriodic:false
06-29 11:37:56.844 5627-5642/? V/NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 259 native methods...
06-29 11:37:56.872 5627-5642/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
06-29 11:37:56.876 5627-5642/? I/ProviderInstaller: Installed default security provider GmsCore_OpenSSL
06-29 11:37:56.877 5627-5642/? I/MS_RegisterService: Not registered and not enabled. Doing nothing.

回答1:

The white screen is visible that means your instant app is running well in emulator. First post your full code so that I can suggest something in better way. Meanwhile, there are some points you check cross check: 1. Check if the XML file of your java activity file is having some text to display on screen. 2. If your app is installed in the emulator, just uninstall it first then select your instant app to run on emulator.



回答2:

change the emulator's graphics emulated performance from automatic to either Hardware GLES 2.0 or Software GLES 2.0 as shown in this blogpost: http://dominoc925.blogspot.fr/2017/08/android-studio-emulator-how-i-resolved.html



回答3:

Resolved white screen. possible encounters are

1) if following message

in terminal window I/mple.myfirstap: Background concurrent copying GC freed 8149(516KB) AllocSpace objects, 0(0B) LOS objects, 50% free, 1828KB/3MB, paused 5.100ms total 179.836ms D/EGL_emulation: eglMakeCurrent: 0xe0724840: ver 2 0 (tinfo 0xe27cddc0) Application terminated.

Goto layout/activity_display_message.xml -> Select textView component -> And in Attributes window remove Hardcoded string "textValue", (should not use @string resource) clear the hardcoded textValue and keep it empty for the textbox

2) Optionally you can try uninstalling the app from the emulator and build it again.



回答4:

Create a new project and see if again nothing shows. There is no problem in your SDK. If SDK fails then your android studio will not start and gives you message to download SDK or give the path of SDK.