google-developer-training / basic-android-kotlin-compose-training-woof

Apache License 2.0
55 stars 87 forks source link

Unable to launch the app after material theming with jetpack compose #54

Closed ayaankhan98 closed 1 year ago

ayaankhan98 commented 1 year ago

URL of codelab https://developer.android.com/codelabs/basic-android-kotlin-compose-material-theming?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-3-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-material-theming#7

In which task and step of the codelab can this issue be found? After completing the task

Describe the problem Unable to launch the app, please see the logs for more information

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions Android Studio version: 2022.3.1 API version of the emulator: Pixel 6 Pro API 31

Additional information

Logcat ### Logs ```kotlin --------- beginning of main --------- beginning of kernel --------- beginning of system --------- beginning of crash 2023-07-29 01:11:26.519 7051-7051 om.example.woo com.example.woof I Late-enabling -Xcheck:jni 2023-07-29 01:11:26.591 7051-7051 om.example.woo com.example.woof W Unexpected CPU variant for X86 using defaults: x86_64 2023-07-29 01:11:27.089 7051-7051 om.example.woo com.example.woof W DexFile /data/data/com.example.woof/code_cache/.studio/instruments-45c255fe.jar is in boot class path but is not in a known location 2023-07-29 01:11:27.065 7051-7051 re-initialized> com.example.woof W type=1400 audit(0.0:38): avc: granted { execute } for path="/data/data/com.example.woof/code_cache/startup_agents/566ca8ec-agent.so" dev="dm-5" ino=156622 scontext=u:r:untrusted_app:s0:c145,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c145,c256,c512,c768 tclass=file app=com.example.woof 2023-07-29 01:11:27.603 7051-7051 om.example.woo com.example.woof W Current dex file has more than one class in it. Calling RetransformClasses on this class might fail if no transformations are applied to it! 2023-07-29 01:11:27.735 7051-7051 om.example.woo com.example.woof W Current dex file has more than one class in it. Calling RetransformClasses on this class might fail if no transformations are applied to it! 2023-07-29 01:11:27.737 7051-7051 om.example.woo com.example.woof W Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled. 2023-07-29 01:11:27.737 7051-7051 om.example.woo com.example.woof W Redefining intrinsic method boolean java.lang.Thread.interrupted(). This may cause the unexpected use of the original definition of boolean java.lang.Thread.interrupted()in methods that have already been compiled. 2023-07-29 01:11:27.764 7051-7051 om.example.woo com.example.woof W Current dex file has more than one class in it. Calling RetransformClasses on this class might fail if no transformations are applied to it! 2023-07-29 01:11:27.974 7051-7051 om.example.woo com.example.woof W Current dex file has more than one class in it. Calling RetransformClasses on this class might fail if no transformations are applied to it! 2023-07-29 01:11:28.175 7051-7051 om.example.woo com.example.woof W Current dex file has more than one class in it. Calling RetransformClasses on this class might fail if no transformations are applied to it! 2023-07-29 01:11:28.184 7051-7051 Compatibil...geReporter com.example.woof D Compat change id reported: 171979766; UID 10145; state: ENABLED 2023-07-29 01:11:28.604 7051-7063 System com.example.woof W A resource failed to call close. 2023-07-29 01:11:28.844 7051-7051 GraphicsEnvironment com.example.woof V ANGLE Developer option for 'com.example.woof' set to: 'default' 2023-07-29 01:11:28.844 7051-7051 GraphicsEnvironment com.example.woof V Neither updatable production driver nor prerelease driver is supported. 2023-07-29 01:11:28.849 7051-7051 NetworkSecurityConfig com.example.woof D No Network Security Config specified, using platform default 2023-07-29 01:11:28.850 7051-7051 NetworkSecurityConfig com.example.woof D No Network Security Config specified, using platform default 2023-07-29 01:11:28.909 7051-7072 libEGL com.example.woof D loaded /vendor/lib64/egl/libEGL_emulation.so 2023-07-29 01:11:28.915 7051-7072 libEGL com.example.woof D loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so 2023-07-29 01:11:28.919 7051-7072 libEGL com.example.woof D loaded /vendor/lib64/egl/libGLESv2_emulation.so 2023-07-29 01:11:29.159 7051-7051 om.example.woo com.example.woof W Class androidx.compose.runtime.snapshots.SnapshotStateMap failed lock verification and will run slower. Common causes for lock verification issues are non-optimized dex code and incorrect proguard optimizations. 2023-07-29 01:11:29.299 7051-7070 HostConnection com.example.woof D createUnique: call 2023-07-29 01:11:29.300 7051-7070 HostConnection com.example.woof D HostConnection::get() New Host Connection established 0x7d8411014710, tid 7070 2023-07-29 01:11:29.308 7051-7070 HostConnection com.example.woof D HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1 2023-07-29 01:11:29.311 7051-7070 OpenGLRenderer com.example.woof W Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 2023-07-29 01:11:29.311 7051-7070 OpenGLRenderer com.example.woof W Failed to initialize 101010-2 format, error = EGL_SUCCESS 2023-07-29 01:11:29.313 7051-7070 EGL_emulation com.example.woof D eglCreateContext: 0x7d8411014950: maj 3 min 1 rcv 4 2023-07-29 01:11:29.314 7051-7070 EGL_emulation com.example.woof D eglMakeCurrent: 0x7d8411014950: ver 3 1 (tinfo 0x7d8631b03080) (first time) 2023-07-29 01:11:29.339 7051-7070 Gralloc4 com.example.woof I mapper 4.x is not supported 2023-07-29 01:11:29.341 7051-7070 HostConnection com.example.woof D createUnique: call 2023-07-29 01:11:29.342 7051-7070 HostConnection com.example.woof D HostConnection::get() New Host Connection established 0x7d8411012850, tid 7070 2023-07-29 01:11:29.342 7051-7070 goldfish-address-space com.example.woof D allocate: Ask for block of size 0x100 2023-07-29 01:11:29.342 7051-7070 goldfish-address-space com.example.woof D allocate: ioctl allocate returned offset 0x3ebffe000 size 0x2000 2023-07-29 01:11:29.396 7051-7070 Gralloc4 com.example.woof W allocator 4.x is not supported 2023-07-29 01:11:29.427 7051-7070 HostConnection com.example.woof D HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1 2023-07-29 01:11:29.493 7051-7051 AndroidRuntime com.example.woof D Shutting down VM 2023-07-29 01:11:29.499 7051-7051 AndroidRuntime com.example.woof E FATAL EXCEPTION: main Process: com.example.woof, PID: 7051 java.lang.IllegalStateException: Could not load font at androidx.compose.ui.text.font.TypefaceRequestCache.runCached(FontFamilyResolver.kt:200) at androidx.compose.ui.text.font.FontFamilyResolverImpl.resolve(FontFamilyResolver.kt:92) at androidx.compose.ui.text.font.FontFamilyResolverImpl.resolve-DPcqOEQ(FontFamilyResolver.kt:79) at ```
ayaankhan98 commented 1 year ago

I think this was because of the fact that I loaded the xml fonts direclty from android studio font import option, instead of downloading them from web in ttf format.