cunarist / rinf

Rust for native business logic, Flutter for flexible and beautiful GUI
MIT License
1.99k stars 72 forks source link

Add support for Android Gradle Plugin 8.0.0 #242

Closed ngoquang2708 closed 10 months ago

ngoquang2708 commented 10 months ago

Report

Error when build with APG 8.0.0. Error log:

Namespace not specified. Please specify a namespace in the module's build.gradle file like so:

android {
    namespace 'com.example.namespace'
}

If the package attribute is specified in the source AndroidManifest.xml, it can be migrated automatically to the namespace value in the build.gradle file using the AGP Upgrade Assistant; please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

I can build successfully if I add namespace "com.cunarist.rinf" to :rinf module build.gradle manually.

Steps to Reproduce

Build with an Android project APG version set to 8.0.0

System Information

rustc --version: rustc 1.74.1 (a28077b28 2023-12-04)
protoc --version: libprotoc 25.1
flutter doctor: Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.3, on Arch Linux 6.6.6-arch1-1, locale en_GB.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2023.1)
[✓] IntelliJ IDEA Community Edition (version 2023.2)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 1 category.
temeddix commented 10 months ago

Thanks for the report!

I will look into this, but still am not sure how it can be solved on the Rinf side. Do you mind sharing your whole gradle file?

ngoquang2708 commented 10 months ago

Here is my sample project which failed to build because of missing com.cunarist.rinf namespace. After manually add namespace 'com.cunarist.rinf' to rinf build.gradle, I can build successful. FYI: https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes: AGP 8.0.0 Add breaking changes that require namespace to be specified in module-level build script.

temeddix commented 10 months ago

I see, thanks for the details :)

Would adding that one line solve this problem? If it does, I will apply the change and publish the new version right away.