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

fix: Android Namespace error #166

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

robotoss
Copy link

@robotoss robotoss commented Nov 4, 2024

Summary

This PR updates the build.gradle file to improve compatibility with the latest Android Gradle Plugin (AGP) and Kotlin version, while also enhancing the project’s structure and testing capabilities.

Changes

  1. Updated Plugin and Library Versions:

    • Gradle Plugin: Upgraded from 7.4.2 to 8.1.0.
  2. Project Group and Version:

    • Converted group and version syntax from Groovy-style to Kotlin-style (= syntax).
  3. Repositories:

    • Added mavenCentral() alongside google() in both buildscript and allprojects for broader dependency resolution.
  4. Android Configuration:

    • Namespace Definition: Modified the namespace configuration to use the Kotlin-style assignment (=) syntax for AGP compatibility.
    • SDK Versions:
      • Increased compileSdk from 31 to 34.
      • Raised minSdk from 16 to 21 for improved compatibility with newer libraries.
  5. Source Sets Configuration:

    • Updated sourceSets to include Kotlin-specific directories:
      • main.java.srcDirs += "src/main/kotlin"
      • test.java.srcDirs += "src/test/kotlin"
  6. Code Quality and Compatibility:

    • Added kotlinOptions with jvmTarget = JavaVersion.VERSION_1_8 for consistency with compileOptions.

Impact

  • Improves compatibility with newer versions of Android and Kotlin.
  • Facilitates better test management with JUnitPlatform and standard logging configurations.
  • Aligns project structure with modern Android development practices by adding Kotlin support and increasing minimum SDK version.

@robotoss
Copy link
Author

robotoss commented Nov 6, 2024

Hey @MisterJimson ,

Could you take a quick look at PR #166r? It support new version Android studio with java

Thanks a lot!

}

compileSdkVersion 31
compileSdk = 34

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@robotoss robotoss requested a review from EchoEllet January 26, 2025 08:20
Copy link

@EchoEllet EchoEllet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, while I'm not a maintainer of this repo, what is the issue you're encountering, Is it Java 8 warnings after updating to Android Ladybug?

@robotoss
Copy link
Author

LGTM, while I'm not a maintainer of this repo, what is the issue you're encountering, Is it Java 8 warnings after updating to Android Ladybug?

I understand
I just wanted to clarify so that maintenrea would have fewer questions if he opens a merge request =)

From the experience of current projects i just used the fix on Mac OS

  1. brew install openjdk@17
  2. flutter config --jdk-dir /opt/homebrew/opt/openjdk@17
  3. restart Terminal and Android Studio

to avoid problems with JAVA using LadyBag

@EchoEllet
Copy link

flutter config --jdk-dir /opt/homebrew/opt/openjdk@17

It's better to update AGP, Gradle, and the dependencies instead of changing the default Android Studio JDK.

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

Successfully merging this pull request may close these issues.

2 participants