Вот код i ' m Использование для сохранения и открытия файла PDF: < /p>
Код: Выделить всё
openFile() async {
String storeNameForInvoice = '${storeName.value} - $date';
final invoicesPath = await getTargetDirectoryPath();
final file = File("$invoicesPath/$storeNameForInvoice.pdf");
await file.writeAsBytes(await pdf.save());
await saveInvoiceToFirestore();
loadInvoicesToCurrentInvoice(storeName.value);
await OpenFile.open(file.path);
}
gradle version
in gradle-wrapper.properties : < /p>
Код: Выделить всё
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
in build.gradle (level приложение) :
Код: Выделить всё
compileSdk = 34
targetSdk = 34
Код: Выделить всё
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
}()
includeBuild("$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 "7.3.0" apply false
id "com.google.gms.google-services" version "4.3.15" apply false
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
}
include ":app"
Ошибка, которая появляется в консоли, следующая:
Код: Выделить всё
C:\Users\MQ\AppData\Local\Pub\Cache\hosted\pub.dev\open_file_plus-3.4.1+1\android\src\main\java\com\joutvhu\openfile\OpenFilePlusPlugin.java:66: error: cannot find symbol
public static void registerWith(PluginRegistry.Registrar registrar) {
^
symbol: class Registrar
location: interface PluginRegistry
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':open_file_plus:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.
BUILD FAILED in 1m 20s
Error: Gradle task assembleDebug failed with exit code 1
Я попробовал несколько шагов для решения этой проблемы, включая: < br/> Запуск обновления Flutter
Запуск Fluther Clean
Выполнение обновления Flutter Pub
Проверка устаревших пакетов с Flutter Pub устарело < /code> < /p>
Несмотря на эти попытки, проблема сохраняется. Кроме того, я проверил другие библиотеки, такие как open_file ,
Код: Выделить всё
url_launcher
Вопрос: Вопрос: Вопрос: Вопрос: Вопрос:
Что может привести к ошибке плагинарегистика. Регистрация, и как я могу решить эту проблему для успешного открытия файлов PDF в моем Платорское приложение?
Подробнее здесь: https://stackoverflow.com/questions/791 ... not-find-s