GeneratedPluginRegistrant.java никогда не восстанавливается во FlutterJAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 GeneratedPluginRegistrant.java никогда не восстанавливается во Flutter

Сообщение Anonymous »

Шаги по воспроизведению
  • независимо от того, сколько раз я запускаю flutter clean и flutter pug get, GeneratedPluginRegistrant.java никогда не перегенерируется.
  • версия flutter 3.22.3, в настоящее время я не могу ее обновить, потому что это вызовет еще больше конфликтов зависимостей.
  • когда я запускаю flutter build appbundle --release --dart- define=ENVIRONMENT=PROD
    он жалуется на ошибки, связанные с плагином (я проверил /Users/john.z/.pub-cache/hosted/pub.dev/, все они установлены правильно, см. рисунок ниже). )
Ожидаемые результаты
GeneratedPluginRegistrant.java повторно создать
Фактические результаты
GeneratedPluginRegistrant.java никогда не перегенерируется
Пример кода
мой предыдущий GeneratedPluginRegistrant.java
package io.flutter.plugins;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.Log;

import io.flutter.embedding.engine.FlutterEngine;

/**
* Generated file. Do not edit.
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
private static final String TAG = "GeneratedPluginRegistrant";
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
try {
flutterEngine.getPlugins().add(new com.transistorsoft.flutter.backgroundfetch.BackgroundFetchPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin background_fetch, com.transistorsoft.flutter.backgroundfetch.BackgroundFetchPlugin", e);
}
try {
flutterEngine.getPlugins().add(new com.mr.flutter.plugin.filepicker.FilePickerPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin file_picker, com.mr.flutter.plugin.filepicker.FilePickerPlugin", e);
}
try {
flutterEngine.getPlugins().add(new com.jrai.flutter_keyboard_visibility.FlutterKeyboardVisibilityPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin flutter_keyboard_visibility, com.jrai.flutter_keyboard_visibility.FlutterKeyboardVisibilityPlugin", e);
}
try {
flutterEngine.getPlugins().add(new com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin flutter_local_notifications, com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin flutter_plugin_android_lifecycle, io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.github.ponnamkarthik.toast.fluttertoast.FlutterToastPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin fluttertoast, io.github.ponnamkarthik.toast.fluttertoast.FlutterToastPlugin", e);
}
try {
flutterEngine.getPlugins().add(new uk.co.moodio.msal_flutter.MsalFlutterPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin msal_flutter, uk.co.moodio.msal_flutter.MsalFlutterPlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e);
}
try {
flutterEngine.getPlugins().add(new name.avioli.unilinks.UniLinksPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin uni_links, name.avioli.unilinks.UniLinksPlugin", e);
}
try {
flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin package_info_plus, io.flutter.plugins.packageinfo.PackageInfoPlugin", e);
}
}
}



Снимки экрана или видео

Снимки экрана
[img]https: //github.com/user-attachments/assets/e907a2ba-cc38-4786-b04d-67d31b5ad665[/img]
[img]https://github .com/user-attachments/assets/21abd7f8-1d17-4187-8267-3350351a2e15[/img]


Журналы
журналы ошибок
/Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:19: error: package com.transistorsoft.flutter.backgroundfetch does not exist
flutterEngine.getPlugins().add(new com.transistorsoft.flutter.backgroundfetch.BackgroundFetchPlugin());
^
/Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:24: error: package com.mr.flutter.plugin.filepicker does not exist
flutterEngine.getPlugins().add(new com.mr.flutter.plugin.filepicker.FilePickerPlugin());
^
/Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:29: error: package com.jrai.flutter_keyboard_visibility does not exist
flutterEngine.getPlugins().add(new com.jrai.flutter_keyboard_visibility.FlutterKeyboardVisibilityPlugin());
^
/Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:34: error: package com.dexterous.flutterlocalnotifications does not exist
flutterEngine.getPlugins().add(new com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin());
^
/Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:39: error: package io.flutter.plugins.flutter_plugin_android_lifecycle does not exist
flutterEngine.getPlugins().add(new io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin());
^
/Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:44: error: package io.github.ponnamkarthik.toast.fluttertoast does not exist
flutterEngine.getPlugins().add(new io.github.ponnamkarthik.toast.fluttertoast.FlutterToastPlugin());
^
/Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:49: error: package uk.co.moodio.msal_flutter does not exist
flutterEngine.getPlugins().add(new uk.co.moodio.msal_flutter.MsalFlutterPlugin());
^
/Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:54: error: package io.flutter.plugins.sharedpreferences does not exist
flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
^
/Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:59: error: package name.avioli.unilinks does not exist
flutterEngine.getPlugins().add(new name.avioli.unilinks.UniLinksPlugin());
^
/Users/john.z/Desktop/frontendRepos/flutter_alp_invoicing/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:64: error: package dev.fluttercommunity.plus.packageinfo does not exist
flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin());
^
10 errors


Вывод Flutter Doctor
Вывод доктора
[!] Flutter (Channel [user-branch], 3.22.3, on macOS 14.6.1 23G93 darwin-arm64, locale en-CN)
! Flutter version 3.22.3 on channel [user-branch] at /Users/john.z/development/flutter
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
! Upstream repository unknown source is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1.3)
[✓] VS Code (version 1.95.0)
[✓] Connected device (4 available)
! Error: Browsing on the local area network for ShiroPika@iPhone14ProMax. Ensure the device is unlocked and attached with a cable or associated with the
same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for John的iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area
network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[!] Network resources
✗ A network error occurred while checking "https://maven.google.com/": Operation timed out
✗ A network error occurred while checking "https://github.com/": Operation timed out

! Doctor found issues in 2 categories.


Подробнее здесь: https://stackoverflow.com/questions/791 ... in-flutter
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»