Skip to content

Cannot start FlutterActivity when adding flutterpart library as aar module to existing application #18025

@tomergoldst

Description

@tomergoldst

Steps to Reproduce

  1. Create new flutter project

  2. Create new Android app

  3. Add flutter project into existing android app (from step 2) according to

  4. run the android app and start the MainActivity of flutter project -> everything works

  5. run gradle -> assemble for the flutter project Build directory

  6. copy the flutterpart-release.aar generated at build/outputs/arr

  7. Create a different new Android app

  8. Create new module ->Import JAR/ARR package -> select flutterpart-release.aar -> finish

  9. add to app build.grade "implementation project(':flutterpart')"

  10. add button to start flutterpart MainAcitivty
    ComponentName componentName = new ComponentName(getBaseContext(),
    "com.example.flutterpart.MainActivity");
    Intent intent = new Intent().setComponent(componentName);
    startActivity(intent);

  11. Run the app -> click the button -> app crashed

Logs

Crash log

05-30 16:32:36.124 21199-21199/com.example.androidwithflutter3 A/flutter: [FATAL:flutter/fml/icu_util.cc(95)] Check failed: context->IsValid(). Must be able to initialize the ICU context. Tried: /data/user/0/com.example.androidwithflutter3/app_flutter/icudtl.dat
05-30 16:32:36.124 21199-21199/com.example.androidwithflutter3 A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 21199 (oidwithflutter3)
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.4.4, on Microsoft Windows [Version 10.0.16299.125], locale he-IL)
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[√] Android Studio (version 3.1)
[!] IntelliJ IDEA Community Edition (version 2018.1)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] Connected devices (1 available)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: existing-appsIntegration with existing apps via the add-to-app flowengineflutter/engine related. See also e: labels.t: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions