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

Add namespace to support Android Gradle Plugin (AGP) 8.x.x #198

Open
xavierraffin opened this issue Jan 20, 2025 · 14 comments
Open

Add namespace to support Android Gradle Plugin (AGP) 8.x.x #198

xavierraffin opened this issue Jan 20, 2025 · 14 comments

Comments

@xavierraffin
Copy link

xavierraffin commented Jan 20, 2025

Some packages I am using in my Flutter app requires Android SDK target version 35. But this SDK version require to update Gradle to version 8.
I tried upgrading my project Android Gradle Plugin (AGP) from 7.4.2 to 8.1.0 using AGP Upgrade Assistant in Android Studio but it failed. AGP 8.x.x force the use of namespace in the module's build.gradle file. This is the error I'm getting due to no namespace:

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

This can be fixed manually by adding a namespace in the module's build.gradle file like this:

android {
    namespace 'com.rudderstack' // Adding this line fixes the issue

    compileSdkVersion 35

    defaultConfig {
        ..
    }
    ..
@contributor-support
Copy link

Thanks for opening this issue! We'll get back to you shortly. If it is a bug, please make sure to add steps to reproduce the issue.

@1abhishekpandey
Copy link
Contributor

Hey @@xavierraffin
Could you please provide the flutter SDK version that you're using?

@xavierraffin
Copy link
Author

xavierraffin commented Jan 21, 2025

We use rudder_sdk_flutter: ^3.0.1
This is the last available on https://pub.dev/packages/rudder_sdk_flutter

@xavierraffin
Copy link
Author

We tried to use the Github version directly but it is complex to do in our build pipeline.
If the version 4.1.0 supports AGP 8+ and SDK 35 then it will be simpler if you could publish it on pub.dev.
Thank you very much

@1abhishekpandey
Copy link
Contributor

We are actively working on it and will try to provide support for AGP version 8.x.x soon. We will keep you updated.

@Sumant-Grexa
Copy link

Which version of gradle will allow the current sdk (will not strict check for namespace)

@1abhishekpandey
Copy link
Contributor

@Sumant-Grexa Any Gradle version before 8.0.0, such as 7.4.2, does not enforce strict checks for the namespace property.

@1abhishekpandey
Copy link
Contributor

Hey @xavierraffin,
We have added the namespace to our Flutter Android SDK making it compatible with Gradle v8.x.x. Please update to this version rudder_sdk_flutter: 3.1.0.

@Sumant-Grexa
Copy link

Hey @1abhishekpandey, Glad to see the new update. Meanwhile we are using rudder_integration_firebase_flutter too in our flutter app and the new update shows a dependency error

Because rudder_integration_firebase_flutter 1.0.1 depends on rudder_sdk_flutter ^2.1.2 and no versions of rudder_integration_firebase_flutter match >1.0.1 <2.0.0, rudder_integration_firebase_flutter ^1.0.1 requires rudder_sdk_flutter ^2.1.2.
So, because our_app depends on both rudder_sdk_flutter ^3.1.0 and rudder_integration_firebase_flutter ^1.0.1, version solving failed.

Can we do something here.

@1abhishekpandey
Copy link
Contributor

Please use the latest version: rudder_integration_firebase_flutter: 4.2.0 and let us know if you face any issues.

@Sumant-Grexa
Copy link

After upgrading both the packages
rudder_sdk_flutter: ^3.1.0
rudder_integration_firebase_flutter: 4.2.0

Because no versions of rudder_sdk_flutter match >3.1.0 <4.0.0 and rudder_sdk_flutter 3.1.0 depends on rudder_plugin_web ^3.0.2, rudder_sdk_flutter ^3.1.0 requires rudder_plugin_web ^3.0.2.
And because no versions of rudder_plugin_web match >3.0.2 <4.0.0 and rudder_plugin_web 3.0.2 depends on js ^0.7.1, rudder_sdk_flutter ^3.1.0 requires js ^0.7.1.
And because flutter_secure_storage >=9.1.1 <10.0.0-beta.1 depends on flutter_secure_storage_web ^1.2.1 which depends on js ^0.6.3, rudder_sdk_flutter ^3.1.0 is incompatible with flutter_secure_storage >=9.1.1 <10.0.0-beta.1.
So, because our_app depends on both flutter_secure_storage ^9.2.4 and rudder_sdk_flutter ^3.1.0, version solving failed.

@1abhishekpandey
Copy link
Contributor

This error is due to the use of a different version of js. Our SDK uses the js version 0.7.1 whereas the flutter_secure_storage seems to be relying on js version 0.6.3.

I would propose to update the flutter_secure_storage to a more recent version which is compatible with the js version 0.7.1. Or override the js version to 0.6.3, if you're not using our Flutter-Web SDK (use this with approach caution).

Also, you can try loading our Flutter SDK in a sample Flutter project without any other dependency to see if this issue happens or not.

@Sumant-Grexa
Copy link

Yes I got the root cause.
We are using flutter_secure_storage version: 9.2.4. This is currently the most updated version. Coming to your second suggestion we are using rudderstack for web too it helps us to manage events efficiently can we use js version which matches with most of the globally used package deps ? Sorry if i am in wrong direction.

@1abhishekpandey
Copy link
Contributor

Regarding this:

can we use js version which matches with most of the globally used package deps ?

You have two options:

  1. You can use the js version, which matches with most of the globally used package dependencies. However, this might require overriding the js package to a specific version, which will need testing.
  2. The best approach is to find a compatible version where all packages use the same js version.

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