Guang1234567 / swift-android-architecture

Apache License 2.0
0 stars 0 forks source link

App crash while running on Android R emulator #1

Open XiyaoXirui opened 1 year ago

XiyaoXirui commented 1 year ago

Hi Guang,

After following the instructions of README.md, I built the final APK file successfully. But after running it on an Android R arm64 emulator, the app crashed. Below is the full android log. Am I doing something wrong? thanks

23:46:50.105 371-628 installd installd E Dex2oat invocation for /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/base.apk failed: exec(dex2oat) (18432) ---------------------------- PROCESS STARTED (2726) for package com.example.android.architecture.blueprints.todomvvmlive ---------------------------- 23:47:05.341 2726-2726 NetworkSecurityConfig com...cture.blueprints.todomvvmlive D No Network Security Config specified, using platform default 23:47:05.341 2726-2726 NetworkSecurityConfig com...cture.blueprints.todomvvmlive D No Network Security Config specified, using platform default 23:47:05.346 2726-2752 libEGL com...cture.blueprints.todomvvmlive D loaded /vendor/lib64/egl/libEGL_emulation.so 23:47:05.347 2726-2752 libEGL com...cture.blueprints.todomvvmlive D loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so 23:47:05.348 2726-2752 libEGL com...cture.blueprints.todomvvmlive D loaded /vendor/lib64/egl/libGLESv2_emulation.so 23:47:05.406 2726-2726 ts.todomvvmliv com...cture.blueprints.todomvvmlive W Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed) 23:47:05.406 2726-2726 ts.todomvvmliv com...cture.blueprints.todomvvmlive W Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed) 23:47:05.409 2726-2726 AppCompatViewInflater com...cture.blueprints.todomvvmlive I app:theme is now deprecated. Please move to using android:theme instead. 23:47:05.434 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: Int 23:47:05.435 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: Int8 23:47:05.435 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: Int16 23:47:05.435 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: Int32 23:47:05.435 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: Int64 23:47:05.435 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: UInt 23:47:05.435 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: UInt8 23:47:05.435 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: UInt16 23:47:05.435 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: UInt32 23:47:05.436 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: UInt64 23:47:05.436 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: Float 23:47:05.436 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: Double 23:47:05.436 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: Bool 23:47:05.436 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: String 23:47:05.436 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: Date 23:47:05.436 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: URL 23:47:05.436 2726-2726 Swift com...cture.blueprints.todomvvmlive W JavaCoderConfig register: Data 23:47:05.436 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive E ScopedNativeTraceSection.sdkVersion = 30 23:47:05.436 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive W TasksRepository init !!! 23:47:05.436 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive I
23:47:05.436 2726-2726 chatty com...cture.blueprints.todomvvmlive I uid=10130(com.example.android.architecture.blueprints.todomvvmlive) identical 1 line 23:47:05.436 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive I
23:47:05.436 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive I 👇👇👇 case1 : print current 23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive I
23:47:05.437 2726-2726 chatty com...cture.blueprints.todomvvmlive I uid=10130(com.example.android.architecture.blueprints.todomvvmlive) identical 1 line 23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive I
23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive I 👇👇👇👇👇 case2 : Backtrace.capture 23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive E oilEmpty(message: "!!! oil empty !!!")

                                                                                                Backtrace:

23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive I
23:47:05.437 2726-2726 chatty com...cture.blueprints.todomvvmlive I uid=10130(com.example.android.architecture.blueprints.todomvvmlive) identical 1 line 23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive I
23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive I 👇👇👇👇👇👇👇👇👇 case3 : fatalError 23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive I 👆👆👆👆👆👆👆👆👆 note: never print this line !!! 23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive W TasksRepository init !!!2222 23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive W TasksRepository init !!!333 23:47:05.437 2726-2726 Swift com...cture.blueprints.todomvvmlive W SQLiteDB opened! 23:47:05.437 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive W isOpened = true 23:47:05.447 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive W Found category with ID = 1 23:47:05.449 2726-2726 TasksRepository com...cture.blueprints.todomvvmlive W Deleted category with ID = 1 23:47:05.450 2726-2726 libc com...cture.blueprints.todomvvmlive A Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7267436e696f52 in tid 2726 (ts.todomvvmlive), pid 2726 (ts.todomvvmlive) 23:47:05.450 2726-2753 Swift com...cture.blueprints.todomvvmlive W beginTransaction0<Thread: 0x0000007054740800> 23:47:05.453 2726-2753 Swift com...cture.blueprints.todomvvmlive W beginTransaction1<Thread: 0x0000007054740800> 23:47:05.453 2726-2753 Swift com...cture.blueprints.todomvvmlive W beginTransaction2<Thread: 0x0000007054740800> 23:47:05.453 2726-2753 Swift com...cture.blueprints.todomvvmlive W rollback2<Thread: 0x0000007054740800> 23:47:05.453 2726-2753 Swift com...cture.blueprints.todomvvmlive W rollback1<Thread: 0x0000007054740800> 23:47:05.453 2726-2753 Swift com...cture.blueprints.todomvvmlive W rollback0<Thread: 0x0000007054740800> 23:47:05.454 2726-2756 Swift com...cture.blueprints.todomvvmlive W beginTransaction0<Thread: 0x0000007054746dd0> 23:47:05.454 2726-2756 Swift com...cture.blueprints.todomvvmlive W beginTransaction1<Thread: 0x0000007054746dd0> 23:47:05.454 2726-2756 Swift com...cture.blueprints.todomvvmlive W beginTransaction2<Thread: 0x0000007054746dd0> 23:47:05.454 2726-2756 Swift com...cture.blueprints.todomvvmlive W rollback2<Thread: 0x0000007054746dd0> 23:47:05.454 2726-2756 Swift com...cture.blueprints.todomvvmlive W rollback1<Thread: 0x0000007054746dd0> 23:47:05.454 2726-2756 Swift com...cture.blueprints.todomvvmlive W rollback0<Thread: 0x0000007054746dd0> 23:47:05.466 2758-2758 DEBUG pid-2758 A pid: 2726, tid: 2726, name: ts.todomvvmlive >>> com.example.android.architecture.blueprints.todomvvmlive <<< 23:47:05.562 2758-2758 DEBUG pid-2758 A #00 pc 00000000003e9354 /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/lib/arm64/libswiftCore.so (swift_release+32) 23:47:05.562 2758-2758 DEBUG pid-2758 A #01 pc 0000000000005404 /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/lib/arm64/libSwift-Posix-Thread.so ($s18Swift_Posix_Thread0bC0CyACyxGSgAA12PThreadParam33_AC03D2D2327D8754A720FB759F283DD9LLCcAGLlfc+240) 23:47:05.562 2758-2758 DEBUG pid-2758 A #02 pc 0000000000005300 /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/lib/arm64/libSwift-Posix-Thread.so ($s18Swift_Posix_Thread0bC0CyACyxGSgAA12PThreadParam33_AC03D2D2327D8754A720FB759F283DD9LLCcAGLlfC+60) 23:47:05.562 2758-2758 DEBUG pid-2758 A #03 pc 00000000000056f0 /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/lib/arm64/libSwift-Posix-Thread.so ($s18Swift_Posix_Thread0bC0CyACyxGSgxSgyKccfC+192) 23:47:05.562 2758-2758 DEBUG pid-2758 A #04 pc 00000000000fe5cc /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/lib/arm64/libTodoCore.so ($s8TodoCore15TasksRepositoryCACycfc+3184) 23:47:05.562 2758-2758 DEBUG pid-2758 A #05 pc 00000000000fd94c /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/lib/arm64/libTodoCore.so ($s8TodoCore15TasksRepositoryCACycfC+40) 23:47:05.562 2758-2758 DEBUG pid-2758 A #06 pc 00000000000743e8 /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/lib/arm64/libTodoCore.so (Java_com_example_android_architecture_blueprints_todoapp_data_source_TasksRepository_init__+104) 23:47:05.562 2758-2758 DEBUG pid-2758 A #14 pc 000000000000172c [anon:dalvik-classes5.dex extracted in memory from /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/base.apk!classes5.dex] (com.example.android.architecture.blueprints.todoapp.Injection.provideTasksRepository+12) 23:47:05.562 2758-2758 DEBUG pid-2758 A #20 pc 0000000000001b06 [anon:dalvik-classes5.dex extracted in memory from /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/base.apk!classes5.dex] (com.example.android.architecture.blueprints.todoapp.ViewModelFactory.getInstance+34) 23:47:05.563 2758-2758 DEBUG pid-2758 A #26 pc 00000000000016ec [anon:dalvik-classes9.dex extracted in memory from /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/base.apk!classes9.dex] (com.example.android.architecture.blueprints.todoapp.tasks.TasksActivity.obtainViewModel+8) 23:47:05.563 2758-2758 DEBUG pid-2758 A #29 pc 00000000000017bc [anon:dalvik-classes9.dex extracted in memory from /data/app/~~lI8I85m-zJyM_SqauGXlmg==/com.example.android.architecture.blueprints.todomvvmlive-pnG7LiBLs0ekoP9UPpG_rg==/base.apk!classes9.dex] (com.example.android.architecture.blueprints.todoapp.tasks.TasksActivity.onCreate+36) ---------------------------- PROCESS ENDED (2726) for package com.example.android.architecture.blueprints.todomvvmlive ----------------------------

Guang1234567 commented 1 year ago

@XiyaoXirui

But after running it on an Android R arm64 emulator, the app crashed.

Could you try in a real arm64 device and give it a Write Extenal storge permission in system setting manully?

Maybe the sqlite3 didnot has rw permission, because the code not request the permission now, hahaha.

Guang1234567 commented 1 year ago

BTW,

https://github.com/Guang1234567/swift_android_all_in_one

has my compiled toolchain which version greater that reddle's