当前位置: 首页 > 知识库问答 >
问题:

Flutter与现有应用程序崩溃

邢令
2023-03-14

我正在尝试将Flutter添加到现有的Android应用程序中,但运行时崩溃了。我遵循以下步骤:https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps.我知道这仍处于测试阶段,可能会在不久的将来变得更好,但我把这个放在这里希望能帮助其他人,或者以防我错过了一些简单的东西。

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!

共有1个答案

艾修然
2023-03-14

你可能想看看Arnold Parge在Medium中的现有Android项目中嵌入Flutter一文。

它详细解释了调整build.gradle、AndroidManifest.xml、MainActivity.java和其他Android文件。

 类似资料:
  • 我已经尝试过几次升级flutter,但似乎也没有任何问题: 我最近换了笔记本电脑,并在这个新的笔记本上查看了我的代码的git存储库。有一些问题,但我最终解决了这些问题。唯一的区别是项目名称现在只是,而包名称是-但我认为这不会造成任何问题。 我的猜测是,问题出在我的中的某个地方:

  • 我在手机上构建应用程序时遇到了以下错误:

  • 有趣的是,当我从头创建一个新应用程序时,pubspec.lock没有任何关于Flutter版本的信息。这个部分现在只包含以下内容:。将来,我怎么知道这个应用程序运行的是哪个版本? 我尝试在我的应用程序中运行“Flutter upgrade”,但那是为了升级SDK,而不是应用程序的Flutter版本。那么我该如何升级我的应用程序来使用最新的Flutter版本呢?还是总是使用最新版本的SDK构建?我不

  • 我最近尝试为ListView创建一个自定义行。我试图从教程中完成它,但当我试图更改它时,它崩溃了,以便行与我希望我的应用程序显示的内容一起工作。错误读出在底部。 --------homescreen.xml--------------------- ----------读出错误--------------------------------------------- 04-07 14:06:40.

  • 问题内容: 当我尝试访问Flask应用程序时,该应用程序崩溃了。 这类似于this或this。但是,我的设置似乎正确。 flask.cli.NoAppException:提供的文件/路径(服务器)似乎不存在。请确认路径正确。如果应用不在PYTHONPATH上,请确保扩展名为.py 我的环境变量设置正确。 我的服务器文件是y目录中没有任何文件。 我不记得对代码进行任何特殊更改。该错误可能来自哪里?

  • 在以前的代码上,谁医生帮了我 现在,android应用程序在我的手机上运行时崩溃了,这是错误日志 第一个问题是在我用相机扫描二维码后,它不能显示在二维码的结果进入 第二个问题是,我从存储器中选择了一个QRcode图像,然后点击确认,它崩溃了 下面是我认为的问题 类型不匹配:推断的类型是Uri?但乌里是意料之中的 冗余SAM构造函数 'onRequestPermissionsResult(Int,数

  • null 脚本'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle'行:838 出了什么问题: 任务“:app:CompileFlutterBuildreLease”执行失败。 null null 应用程序:Build.Gradle

  • 我有以下代码,试图在ListView中创建一个简单的ListAdapter(我以前使用过这段代码,这是我唯一更改内容的地方): 当单步执行时,什么都不会发生,但当运行时,我在ChoreoGrapher中得到了一个null点异常。doCallbacks,当我创建一个空的数组列表时,它不会崩溃: 什么是编舞,为什么它会使我的应用程序崩溃? 我完全被困在可能的问题上,或者如何找出问题所在。Eclipse