flutter_secure_storage icon indicating copy to clipboard operation
flutter_secure_storage copied to clipboard

Android无法使用,编译报错

Open littleGabriel opened this issue 9 months ago • 2 comments

导入: pubspec:flutter_secure_storage: ^9.2.4 import:

import 'package:flutter_secure_storage/flutter_secure_storage.dart';

code:

const storage = FlutterSecureStorage();
        await storage.write(key: 'loginResult', value: _loginResult.toString());

报告错误:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':path_provider_android:androidJdkImage'.
   > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JdkImageTransform: C:\Users\littleGabriel\AppData\Local\Android\sdk\platforms\android-34\core-for-system-modules.jar.
         > Error while executing process C:\Program Files\Android\Android Studio\jbr\bin\jlink.exe with arguments {--module-path C:\Users\littleGabriel\.gradle\caches\transforms-3\4a46fc89ed5f9adfe3afebf74eb8bfeb\transformed\output\temp\jmod --add-modules java.base --output C:\Users\littleGabriel\.gradle\caches\transforms-3\4a46fc89ed5f9adfe3afebf74eb8bfeb\transformed\output\jdkImage --disable-plugin system-modules}

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

littleGabriel avatar Feb 14 '25 12:02 littleGabriel

⚠️ This issue has been marked as stale because it has been open for 60 days with no activity.

If this issue is still relevant, please comment to keep it active. Otherwise, it will be closed in 60 days.

github-actions[bot] avatar Apr 16 '25 02:04 github-actions[bot]

AndroidOptions getAndroidOptions() => const AndroidOptions(
            encryptedSharedPreferences: true,
          );
final storage = FlutterSecureStorage(aOptions: getAndroidOptions());

nini22P avatar Jun 07 '25 11:06 nini22P