Skip to content
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

Unable to run android app with flutter run due to AppsflyerSdkPlugin.java errors #342

Closed
Yonkokilasi opened this issue Sep 11, 2024 · 8 comments

Comments

@Yonkokilasi
Copy link

Describe the bug
A clear and concise description of what the bug is.
After upgrading to appsflyer_sdk: ^6.15.1 I can no longer run my flutter app.
To Reproduce
Steps to reproduce the behavior:
Upgrade appsflyer_sdk to 6.15.1
Do flutter run in your terminal

Expected behavior
A clear and concise description of what you expected to happen.
I get a multitude of errors , Will post the first few here

bad class file: /Users/yonko/.gradle/caches/transforms-3/9dd547163521c1703fdc82b55e52e7bc/transformed/jetified-af-android-sdk-6.15.1-api.jar(/com/appsflyer/AFAdRevenueData.class)
    class file has wrong version 61.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
/Users/yonko/.pub-cache/hosted/pub.dev/appsflyer_sdk-6.15.1/android/src/main/java/com/appsflyer/appsflyersdk/AppsflyerSdkPlugin.java:13: error: cannot access AFLogger
import com.appsflyer.AFLogger;

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot 2024-09-11 at 12 01 43

Desktop (please complete the following information):

  • OS: macOS Sonoma 14.5
  • Browser [e.g. chrome, safari] N/A
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: Pixel 5 API 31
  • OS: Android
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
output of flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.5, on macOS 14.5 23F79 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.92.2)
[✓] VS Code (version 1.74.1)
[✓] VS Code (version 1.93.0)
[✓] Connected device (4 available)
[✓] Network resources
@Yonkokilasi
Copy link
Author

Downgrading to 6.13.0+2 resolved the issue

@pazlavi
Copy link
Collaborator

pazlavi commented Sep 15, 2024

Hi @Yonkokilasi,
Your Java version is 11 when the minimum required version starts 6.15.1 is Java 17
Screenshot 2024-09-15 at 11 46 13

@JosephusZhou
Copy link

It seems that upgrading to Java17 is an irrational behavior and does not consider development compatibility.

@pedroculque
Copy link

I agree with @JosephusZhou , how does this make sense? Will you force all flutter projects to do this migration? I have the same problem

@pazlavi
Copy link
Collaborator

pazlavi commented Sep 19, 2024

AGP v8 required Java 17 as shown here .

@micael-nascimento-smartfit

same issue here, did someone solve this error?

@salmafathi
Copy link

salmafathi commented Dec 21, 2024

download java 17
run this command :
flutter config --jdk-dir "your java path dir"
for me was :
flutter config --jdk-dir "C:\Program Files\Java\jdk-17"

@Dani-Koza-AF
Copy link
Collaborator

@micael-nascimento-smartfit @pedroculque @JosephusZhou @Yonkokilasi
To ensure your app remains available on the Google Play Store, it’s essential to update your targetSdkVersion to meet Google’s latest requirements. As of August 31, 2024, new apps and updates must target at least Android 14 (API level 34). Target API level requirements for Google Play apps.

Aligning with this requirement often necessitates using a compatible Java Development Kit (JDK) version. For instance, the Android Gradle Plugin version 8.x requires JDK 17. Java versions in Android builds

Therefore, to comply with these standards and ensure compatibility, we’ve updated the Java version to 17 in our Flutter plugin. This update not only meets Google’s policies but also enhances security and performance for your app.

For detailed information, please refer to the following resources:
Meet Google Play’s target API level requirement
Java versions in Android builds

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

7 participants