Flutter - 在 Android 上访问隐藏方法 Lsun/misc/Unsafe 错误

2024-03-09

我收到 Flutter 项目的错误。我将开始一一停用插件,并希望找出其中之一是否导致了问题。在那之前,我会将其留在这里,以防有人提出建议。

Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)

Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed) E/GoogleMapController(29124): Cannot enable MyLocation layer as location permissions are not granted

dependencies:
  flutter:
    sdk: flutter
  firebase_auth: ^0.15.5+2
  cloud_firestore: ^0.13.5
  firebase_storage: ^3.1.3
  firebase_core: ^0.4.4+3
  provider: ^4.1.2
  google_sign_in: ^4.4.6
  google_maps_flutter: ^0.5.28
  latlong: ^0.6.1
  flappy_search_bar: ^1.7.2
  http: ^0.12.1
  image_cropper: ^1.2.1
  image_picker: ^0.6.3+4
  geolocator: ^5.3.1


Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E287, locale en-RO)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[!] Android Studio (version 3.5)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.45.1)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

使用 Android Studio 打开 Android 应用程序显示以下通知:

Compilation is not supported for following modules: cloud_firestore, cloud_firestore_web, firebase_auth, 
firebase_core, firebase_auth_web, firebase_core_web, google_maps_flutter, flutter_plugin_android_lifecycle, 
google_sign_in, google_sign_in_web, 
location. 
Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.

根据 Flutter 团队的回复,这是 Android protobuf 问题:https://github.com/flutter/flutter/issues/27095#issuecomment-722857855 https://github.com/flutter/flutter/issues/27095#issuecomment-722857855.

在 Android 11 中已修复:https://android-review.googlesource.com/c/platform/art/+/1294616/ https://android-review.googlesource.com/c/platform/art/+/1294616/.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Flutter - 在 Android 上访问隐藏方法 Lsun/misc/Unsafe 错误 的相关文章

随机推荐