kineapps / flutter_archive

Flutter plugin for creating and extracting ZIP files.
https://pub.dev/packages/flutter_archive
BSD 3-Clause "New" or "Revised" License
57 stars 43 forks source link

FlutterJNI was detached from native C++ #82

Closed stephane-couget closed 1 month ago

stephane-couget commented 1 month ago

Good morning,

With flutter 3.22.1 I get this type of error :

Tried to send a platform message response, but FlutterJNI was detached from native C++. Could not send. Response ID: 40

I believe this comes from Flutter_archive because it is the only plugin that displays this during compilation:

D/FlutterArchivePlugin(7056): onDetachedFromEngine D/FlutterArchivePlugin(7056): doOnDetachedFromEngine - IN D/FlutterArchivePlugin(7056): doOnDetachedFromEngine - OUT

I downgraded Flutter_archive from 6.0.3 to 6.0.0 without success.

` • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160) • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d ✗ Unable to get list of installed Simulator runtimes. • CocoaPods version 1.15.2

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.89.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.90.0

[✓] Connected device (3 available) • SM T970 (mobile) • R52R40AJJ6R • android-arm64 • Android 13 (API 33) • macOS (desktop) • macos • darwin-x64 • macOS 14.5 23F79 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.142

[✓] Network resources • All expected network resources are available.`


distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip


`pluginManagement { def flutterSdkPath = { def properties = new Properties() file("local.properties").withInputStream { properties.load(it) } def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath } settings.ext.flutterSdkPath = flutterSdkPath() includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") repositories { google() mavenCentral() gradlePluginPortal() } } plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "8.3.1" apply false id "org.jetbrains.kotlin.android" version "2.0.0" apply false }

include ":app"`


I add that the problem started under Flutter 3.19.6 and here is for pubspec :

`dependencies: android_id: ^0.3.6 animated_splash_screen: ^1.3.0 animated_text_kit: ^4.2.2 app_settings: ^5.1.1 asset_cache: ^2.1.0 blinking_text: ^1.0.4 cli_util: ^0.4.1 collection: ^1.18.0 connectivity_plus: ^5.0.2 convert: ^3.1.1 cron: ^0.6.0 date_format: ^2.0.7 device_info_plus: ^10.1.0 device_information: ^0.0.4 diacritic: ^0.1.5 dio: ^5.4.3+1 dio_http2_adapter: ^2.5.2 dotted_border: ^2.1.0 easy_colors: ^0.0.2 easy_device_info: ^1.1.0 easy_localization: ^3.0.7 email_validator: ^2.1.17 encrypt: ^5.0.3 equatable: ^2.0.5 excel: ^4.0.3 faker: ^2.1.0 file_picker: ^8.0.3 filesystem_picker: ^4.1.0 fixnum: ^1.1.0 flutter: sdk: flutter flutter_archive: ^6.0.0 flutter_breadcrumb: ^1.0.1 flutter_email_sender: ^6.0.3 flutter_exit_app: ^1.1.2 flutter_image_compress: ^2.3.0 flutter_json_viewer: ^1.0.1 flutter_keyboard_visibility: ^5.4.1 flutter_multi_formatter: ^2.12.8 flutter_riverpod: ^2.5.1 flutter_screen_wake: ^1.0.2 flutter_screenutil: ^5.9.3 flutter_secure_storage: ^9.2.2 flutter_sortable_wrap: ^1.0.5 flutter_staggered_grid_view: ^0.7.0 flutter_svg: '>=1.1.6 <3.0.0' flutter_typeahead: ^5.0.1 flutter_vector_icons: ^2.0.0 flutter_windowmanager: ^0.2.0 fnv: ^1.0.1 form_field_validator: ^1.1.0 freezed_annotation: ^2.4.1 g_json: ^4.1.0 get: ^4.6.6 get_it: ^7.7.0 go_router: ^14.1.4 google_fonts: ^6.2.1 grid_staggered_lite: ^0.0.6 grpc: ^3.2.4 hive: ^2.2.3 hive_flutter: ^1.1.0 html_unescape: ^2.0.0 http_certificate_pinning: ^2.1.3 image: '>=3.2.2 <=5.1.0' image_picker: ^1.1.2 import_sorter: ^4.6.0 internet_connection_checker: ^1.0.0+1 intl: ^0.19.0 intl_phone_number_input: ^0.7.4 io: ^1.0.4 isar_flutter_libs: ^3.1.0+1 isar_generator: ^3.1.0+1 jovial_svg: ^1.1.21 json_annotation: ^4.9.0 json_path: ^0.7.2 json_table: ^2.0.1 keyboard_attachable: ^2.2.0 list_tile_switch: ^1.0.0 loader_plus: ^2.0.4 logging: ^1.2.0 logo_n_spinner: ^0.1.8 mailer: ^6.1.0 mask_text_input_formatter: ^2.9.0 meta: ^1.12.0 move_to_background: ^1.0.2 multi_select_flutter: ^4.1.3 nested: ^1.0.0 number_text_input_formatter: ^1.0.0+8 numberpicker: ^2.1.2 open_file: ^3.3.2 overlay_support: ^2.1.0 page_transition: ^2.1.0 path: '>=1.8.2 <2.0.0' path_drawing: ^1.0.1 path_provider: ^2.1.3 patterns_canvas: ^0.4.0 pdf: ^3.10.8 pdf_manipulator: ^0.5.9 pdf_widget_wrapper: ^1.0.4 pdfrx: ^1.0.65 permission_handler: ^11.3.1 photo_view: ^0.15.0 printing: ^5.12.0 progress_state_button: ^1.0.4 progressive_image: ^2.0.1 protobuf: ^3.1.0 pubspec_parse: ^1.3.0 pubspec_yaml: ^3.1.0 qr_flutter: ^4.1.0 quickalert: ^1.1.0 responsive_grid: ^2.4.4 rflutter_alert: ^2.0.7 rotation_log: ^0.0.1 rounded_loading_button_plus: ^3.0.1 safe_device_continued: ^1.0.2 scidart: ^0.0.2-dev.12 screen_protector: ^1.4.2 screenshot: ^3.0.0 scrollview_observer: ^1.20.0 sembast: ^3.7.1+1 share_plus: ^9.0.0 signature: ^5.5.0 stack_trace: ^1.11.1 substring_highlight: ^1.0.33 system_info2: ^4.0.0 toggle_switch: ^2.3.0 top_snackbar_flutter: ^3.1.0 url_launcher: ^6.3.0 uuid: ^4.4.0 velocity_x: ^4.2.1 yaml: ^3.1.2 yet_another_json_isolate: ^2.0.0 dev_dependencies: analyzer: ^5.13.0 build_runner: ^2.4.10 flutter_lints: ^4.0.0 freezed: ^2.5.0 hive_generator: ^2.0.1 json_serializable: ^6.8.0 documentation: https://localhost environment: sdk: '>=2.19.6 <5.0.0' flutter: assets:


Any ideas on how to fix this? Thank you very much for any help you can define, Best regards,

stephane-couget commented 1 month ago

I've found ! This didn't come from Flutter_archive. On the contrary, he was doing his job well by breaking away. It was the Android Studio debugger that wanted to report an error in the code and by chance it was two reversed instructions while the first exited the program according to the specs. So I'm closing the issue. Good job guys, your code looks great!