Bri*_*ht 23 java android kotlin flutter
当我尝试在我的 flutter 应用程序中构建 android 时,我不断收到此错误。这一切都是在我添加时发生的firebase messaging version 7.0.3。即使删除它后,这个问题仍然存在。
/Users/bright/Desktop/flutter_apps/rush_user_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:20: error: cannot find symbol\n flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin());\n ^\n symbol: class FlutterAndroidLifecyclePlugin \n location: package io.flutter.plugins.flutter_plugin_android_lifecycle \n/Users/bright/Desktop/flutter_apps/rush_user_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:24: error: cannot find symbol\n flutterEngine.getPlugins().add(new io.flutter.plugins.googlemaps.GoogleMapsPlugin());\n ^ \n symbol: class GoogleMapsPlugin \n location: package io.flutter.plugins.googlemaps \n/Users/bright/Desktop/flutter_apps/rush_user_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:25: error: cannot find symbol\n flutterEngine.getPlugins().add(new io.flutter.plugins.googlesignin.GoogleSignInPlugin());\n ^ \n symbol: class GoogleSignInPlugin \n location: package io.flutter.plugins.googlesignin \n/Users/bright/Desktop/flutter_apps/rush_user_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:26: error: cannot find symbol\n flutterEngine.getPlugins().add(new io.flutter.plugins.imagepicker.ImagePickerPlugin());\n ^ \n symbol: class ImagePickerPlugin \n location: package io.flutter.plugins.imagepicker \n/Users/bright/Desktop/flutter_apps/rush_user_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:30: error: cannot find symbol\n flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());\n ^\n symbol: class SharedPreferencesPlugin \n location: package io.flutter.plugins.sharedpreferences \n5 errors \nRunning Gradle task \'assembleDebug\'... Done 102.9s\nException: Gradle task assembleDebug failed with exit code 1\nRun Code Online (Sandbox Code Playgroud)\n这是我的GeneratedPluginRegistrant.java
package io.flutter.plugins;\n\nimport androidx.annotation.Keep;\nimport androidx.annotation.NonNull;\n\nimport io.flutter.embedding.engine.FlutterEngine;\nimport io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry;\n\n/**\n * Generated file. Do not edit.\n * This file is generated by the Flutter tool based on the\n * plugins that support the Android platform.\n */\n@Keep\npublic final class GeneratedPluginRegistrant {\n public static void registerWith(@NonNull FlutterEngine flutterEngine) {\n ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine);\n flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin());\n flutterEngine.getPlugins().add(new io.github.ponnamkarthik.toast.fluttertoast.FlutterToastPlugin());\n flutterEngine.getPlugins().add(new com.baseflow.geolocator.GeolocatorPlugin());\n flutterEngine.getPlugins().add(new com.baseflow.googleapiavailability.GoogleApiAvailabilityPlugin());\n flutterEngine.getPlugins().add(new io.flutter.plugins.googlemaps.GoogleMapsPlugin());\n flutterEngine.getPlugins().add(new io.flutter.plugins.googlesignin.GoogleSignInPlugin());\n flutterEngine.getPlugins().add(new io.flutter.plugins.imagepicker.ImagePickerPlugin());\n com.codeheadlabs.libphonenumber.LibphonenumberPlugin.registerWith(shimPluginRegistry.registrarFor("com.codeheadlabs.libphonenumber.LibphonenumberPlugin"));\n flutterEngine.getPlugins().add(new com.lyokone.location.LocationPlugin());\n flutterEngine.getPlugins().add(new com.baseflow.location_permissions.LocationPermissionsPlugin());\n flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());\n flutterEngine.getPlugins().add(new com.aboutyou.dart_packages.sign_in_with_apple.SignInWithApplePlugin());\n }\n}\n\nRun Code Online (Sandbox Code Playgroud)\n这是我的 android 文件夹结构
\n\n我尝试用谷歌搜索解决方案,但没有找到与我的问题类似的任何建议。这是我的颤振医生输出
\n[\xe2\x9c\x93] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.4 19E287 darwin-x64, locale en-KE)\n[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)\n \xe2\x9c\x97 Android license status unknown.\n Run `flutter doctor --android-licenses` to accept the SDK licenses.\n See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.\n \n[\xe2\x9c\x93] Xcode - develop for iOS and macOS (Xcode 11.5)\n[\xe2\x9c\x93] Android Studio (version 3.6)\n[\xe2\x9c\x93] VS Code (version 1.53.2)\n[\xe2\x9c\x93] Connected device (1 available)\n\n! Doctor found issues in 1 category.\nRun Code Online (Sandbox Code Playgroud)\n这是我的依赖项
\ndependencies:\n flutter:\n sdk: flutter\n carousel_slider: ^2.3.1\n intl_phone_number_input: ^0.5.2+2\n pinput: ^0.2.6\n cupertino_icons: ^1.0.0\n dotted_border: ^1.0.6\n dotted_line: ^2.0.2\n date_field: ^1.0.5\n intl: ^0.16.1\n image_picker: ^0.6.7+22\n flutter_rating_bar: ^3.2.0+1\n signature: ^3.2.0\n scrollable_positioned_list: ^0.1.9\n http: ^0.12.1\n shared_preferences: ^0.5.12+4\n provider: null\n google_maps_flutter: ^1.2.0\n location: ^3.2.4\n geolocator: ^5.3.2+2\n shimmer: ^1.1.2\n flutter_google_places: ^0.2.6\n google_maps_webservice: ^0.0.19\n fluttertoast: ^7.1.6\n flutter_polyline_points: ^0.2.4\n uuid: null\n google_sign_in: ^4.5.9\n sign_in_with_apple: ^2.5.4\n firebase_messaging: ^7.0.3\nRun Code Online (Sandbox Code Playgroud)\n我尝试迁移到新项目并仅传输 lib、ios 和 pubspec.yaml,但错误仍然存在。\n请帮忙!
\nBri*_*ht 13
经过一场大汗淋漓的斗争后,我决定从我得到的无数搜索结果中尝试随机解决方案,瞧
flutter pub cache repair
Run Code Online (Sandbox Code Playgroud)
小智 8
就我而言,我尝试过
flutter clean
flutter pub cache repair
flutter pub get
Run Code Online (Sandbox Code Playgroud)
但没有任何积极的结果,所以我转到位于的应用程序级别 build.gradleandroid/app/build.gradle文件并更改了...SdkVersion值:
android {
compileSdkVersion 33 // was `flutter.compileSdkVersion`
}
defaultConfig {
minSdkVersion 29 // was `flutter.minSdkVersion`
targetSdkVersion 33 // was `flutter.targetSdkVersion`
}
Run Code Online (Sandbox Code Playgroud)
小智 5
您必须已从文件pubspec.yml中分离插件。
缓存需要清理。
flutter clean
flutter pub cache repair
flutter pub get
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
29093 次 |
| 最近记录: |