Skip to content

Execution failed for task ':shared_preferences_android:compileDebugJavaWithJavac' #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Shek863 opened this issue Mar 27, 2025 · 2 comments

Comments

@Shek863
Copy link

Shek863 commented Mar 27, 2025

Version
emailjs: ^4.0.0

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):

[✓] Flutter (Channel stable, 3.29.2, on macOS 14.2.1 23C71 darwin-arm64, locale fr-BJ)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/to/macos-android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.95.3)
[✓] Connected device (4 available)
! Error: Browsing on the local area network for iPhone de ol. 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

! Doctor found issues in 1 category.

Flutter run
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Running Gradle task 'assembleDebug'...
/Users/shegunmontcho/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.8/android/src/main/java/io/flutter/plugins/sharedpreferences/LegacySharedPreferencesPlugin.java:217: error: cannot find symbol
new StringListObjectInputStream(new ByteArrayInputStream(Base64.decode(listString, 0)));
^
symbol: class StringListObjectInputStream
location: class ListEncoder
1 error

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':shared_preferences_android:compileDebugJavaWithJavac'.

Compilation failed; see the compiler output below.
/Users/shegunmontcho/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.8/android/src/main/java/io/flutter/plugins/sharedpreferences/LegacySharedPreferencesPlugin.java:217: error: cannot find symbol
new StringListObjectInputStream(new ByteArrayInputStream(Base64.decode(listString, 0)));
^
symbol: class StringListObjectInputStream
location: class ListEncoder
1 error

  • Try:

Check your code and dependencies to fix the compilation error(s)
Run with --scan to get full insights.

BUILD FAILED in 16s
Error: Gradle task assembleDebug failed with exit code 1

@xr0master
Copy link
Contributor

The error with shared_preferences_android. How can emailjs help you?

flutter/flutter#157911

@vietdhfpt
Copy link

I am also facing the same issue when using flutter web and emailjs (v4.0.0)

../../../../../.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/lib/shared_preferences_web.dart:12:8: Error: Error when reading 'lib/web.dart': No such file or directory
import 'package:web/web.dart' as html;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants