簡體   English   中英

與現有應用程序混亂

[英]Flutter crashing with an existing app

我正在嘗試將Flutter添加到現有的Android應用程序中,但運行時崩潰了。 我正在按照以下步驟操作: https//github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps 我知道這仍然處於測試階段,並且可能會在不久的將來變得更好,但是我想把它放在希望幫助其他人的地方,或者如果我錯過了一些簡單的事情。

在啟動我的FlutterActivity意圖時,活動會啟動,但會立即崩潰應用程序。 開始活動看起來像這樣:

ComponentName componentName = new ComponentName(getActivity(), "com.example.flutterpart.MainActivity");
Intent intent = new Intent().setComponent(componentName);
startActivity(intent);

這是我正在使用的顫動的版本:

$ flutter --version
Flutter 0.4.4 • channel beta • https://github.com/flutter/flutter.git
Framework • revision f9bb4289e9 (4 weeks ago) • 2018-05-11 21:44:54 -0700
Engine • revision 06afdfe54e
Tools • Dart 2.0.0-dev.54.0.flutter-46ab040e58

這是崩潰日志。 這已被修改以保證安全性並使其簡短,因此我可能會遺漏一些重要內容:

I/ActivityManager( 1028): START u0 {cmp=com.sambuo.debug/com.example.flutterpart.MainActivity} from uid 10371 on display 0
V/WindowManager( 1028): addAppToken: AppWindowToken{1d6cd2bf token=Token{1be320de ActivityRecord{20ad6819 u0 com.sambuo.debug/com.example.flutterpart.MainActivity t4763}}} to stack=1 task=4763 at 1
W/linker  (24531): libflutter.so: unused DT entry: type 0x6ffffffe arg 0xd84c
W/linker  (24531): libflutter.so: unused DT entry: type 0x6fffffff arg 0x3
I/FlutterActivityDelegate(24531): onResume app wasn't a FlutterApplication!!
V/WindowManager( 1028): Adding window Window{335d618d u0 com.sambuo.debug/com.example.flutterpart.MainActivity} at 3 of 9 (after Window{368c02b1 u0 com.sambuo.debug/com.sambuo.LoginActivity})
V/WindowManager( 1028): Adding window Window{2711eb53 u0 SurfaceView} at 3 of 10 (before Window{335d618d u0 com.sambuo.debug/com.example.flutterpart.MainActivity})
I/flutter (24531): Observatory listening on http://127.0.0.1:46786/
I/ActivityManager( 1028): Displayed com.sambuo.debug/com.example.flutterpart.MainActivity: +3s945ms (total +25s459ms)
F/google-breakpad(26159): Microdump skipped (uninteresting)
W/google-breakpad(24531): ### ### ### ### ### ### ### ### ### ### ### ### ###
W/google-breakpad(24531): Chrome build fingerprint:
W/google-breakpad(24531): 67.0.3396.68
W/google-breakpad(24531): 339606800
W/google-breakpad(24531): ### ### ### ### ### ### ### ### ### ### ### ### ###
F/libc    (24531): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 26085 (1.ui)
I/DEBUG   (  431): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  431): Build fingerprint: 'motorola/falcon_gpe/falcon_umts:5.1/LMY47M.M005/10:user/release-keys'
I/DEBUG   (  431): Revision: '33728'
I/DEBUG   (  431): ABI: 'arm'
I/DEBUG   (  431): pid: 24531, tid: 26085, name: 1.ui  >>> com.sambuo.debug <<<
I/DEBUG   (  431): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
I/DEBUG   (  431):     r0 00000000  r1 ffffffff  r2 99ef379c  r3 b7c758ac
I/DEBUG   (  431):     r4 b7c75868  r5 99ef379c  r6 b7c75870  r7 b7c62120
I/DEBUG   (  431):     r8 99ef38c8  r9 00000000  sl b7c757ec  fp 00000001
I/DEBUG   (  431):     ip 00000000  sp 99ef3798  lr 955fbef9  pc 956afba8  cpsr 200f0030
I/DEBUG   (  431):
I/DEBUG   (  431): backtrace:
I/DEBUG   (  431):     #00 pc 0030cba8  /data/app/com.sambuo.debug-2/lib/arm/libflutter.so
I/DEBUG   (  431):     #01 pc 0030b543  /data/app/com.sambuo.debug-2/lib/arm/libflutter.so
I/DEBUG   (  431):     #02 pc 0030f0d5  /data/app/com.sambuo.debug-2/lib/arm/libflutter.so
I/DEBUG   (  431):     #03 pc 0030fa53  /data/app/com.sambuo.debug-2/lib/arm/libflutter.so
I/DEBUG   (  431):     #04 pc 0009e91d  /data/app/com.sambuo.debug-2/lib/arm/libflutter.so
I/DEBUG   (  431):     #05 pc 0009d855  /data/app/com.sambuo.debug-2/lib/arm/libflutter.so
I/DEBUG   (  431):     #06 pc 0009d80f  /data/app/com.sambuo.debug-2/lib/arm/libflutter.so
I/DEBUG   (  431):     #07 pc 004397ed  /data/app/com.sambuo.debug-2/lib/arm/libflutter.so
I/DEBUG   (  431):     #08 pc 00000714  <unknown>
E/WifiStateMachine( 1028): WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=10.20 rxSuccessRate=14.46 targetRoamBSSID=any RSSI=-53
D/wpa_supplicant( 1577): wlan0: Control interface command 'SIGNAL_POLL'
I/DEBUG   (  431):
I/DEBUG   (  431): Tombstone written to: /data/tombstones/tombstone_09
W/ActivityManager( 1028): Process com.sambuo.debug has crashed too many times: killing!

我已經能夠使用一個新的Android項目,但我認為我現有的Android項目可能會影響構建。

您可能需要查看文章嵌入Flutter在 Arnold Parge的Medium 中的現有Android項目中。

它詳細解釋了調整build.gradle,AndroidManifest.xml,MainActivity.java和其他android文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM