auth0 / auth0-flutter

Auth0 SDK for Flutter
https://pub.dev/documentation/auth0_flutter/latest/
Apache License 2.0
59 stars 39 forks source link

Missing namespace with android gradle tools version 8.0.0 #281

Closed KirkBushman closed 1 year ago

KirkBushman commented 1 year ago

Checklist

Description

Hello team, An error happens when migrating to the latest Android tools version:

com.android.tools.build:gradle:8.0.0

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':auth0_flutter'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > 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.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 24s

This is due to the fact that in the latest few versions, the namespace has been moved from the manifest to the gradle file. Seems pretty easy to fix, would you like a PR?

Reproduction

Additional context

No response

auth0_flutter version

latest

Flutter version

latest

Platform

Android

Platform version(s)

Android 13 (API 33)

Widcket commented 1 year ago

Hi @KirkBushman, thanks for raising this.

@poovamraj could you please take a look?

poovamraj commented 1 year ago

Hi @KirkBushman Thanks a lot and we would love a PR for this. We would just like to ensure this doesn't break anyone still in the older version. Any reference to it would make it even smoother for us to merge this. TIA 🎉

poovamraj commented 1 year ago

Looks like I just found how Flutter is handling this here - https://github.com/flutter/flutter/pull/128360/files

I can create a PR for this to make things go quick. @KirkBushman would be happy if you can check it out.

KirkBushman commented 1 year ago

@poovamraj I just gave a look, and that fix should work fine, even though the final test would be importing the library on an 8.0.0 Android tools version.

On a larger note, it might be risky in the future to have the library stay behind in versions, as things like this will keep on happening. Probably better to find a way to comply with security restrictions, rather than staying behind. :) Just my 2 cents.

poovamraj commented 1 year ago

Sure @KirkBushman we just want to ensure backward compatibility. We will be updating the version as soon as Flutter drops support :)

The fix will be released soon in our next release. We will close this issue now. @Widcket will notify once the release is out.

KirkBushman commented 10 months ago

Hey @poovamraj @Widcket despite the fix being merged several months ago, no new version was ever published. When is the next one planned for?

Widcket commented 10 months ago

@KirkBushman Apologies for the delay, I'll do a release by EOW.