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

Android build fails with a fresh flutter app on both MacOS and Windows #547

Open
aliajami92 opened this issue Sep 18, 2024 · 6 comments
Open

Comments

@aliajami92
Copy link

aliajami92 commented Sep 18, 2024

I created a new flutter app that was working well, as soon as I added ably_flutter: ^1.2.34 to my dependencies and tried to build again, I was getting this error.

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':ably_flutter'.
> com.android.builder.errors.EvalIssueException: defaultConfig contains custom BuildConfig fields, but the feature is disabled.
  To enable the feature, add the following to your module-level build.gradle:
  android.buildFeatures.buildConfig true

I tried to solve it as suggested in the error message in my project's app/build.gradle but that didn't work, I needed to add the buildConfig true to the build.gradle file of the library itself from Pub cache.
Then I was getting another error for missing namespace in the build.gradle file.

BuildScriptTransformer.
[        ] Using default execution profile
[        ] Could not execute [class org.jetbrains.kotlin.gradle.plugin.statistics.KotlinBuildStatHandler.buildFinished]    
[   +1 ms] FAILURE: Build failed with an exception.
[   +1 ms] * What went wrong:
[        ] A problem occurred configuring project ':ably_flutter'.
[        ] > Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
[        ]    > Namespace not specified. Specify a namespace in the module's build file. See
https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

Which I fixed by adding namespace 'io.ably.flutter.plugin'.

Now my build is working fine, but I tried with different projects on both Windows and Mac and was getting the same issues.

┆Issue is synchronized with this Jira Task by Unito

@sacOO7
Copy link
Collaborator

sacOO7 commented Sep 18, 2024

@aliajami92 Correct me if I am wrong, from last statement, I take that your build is working fine and you are not facing any issues right?

@aliajami92
Copy link
Author

@aliajami92 Correct me if I am wrong, from last statement, I take that your build is working fine and you are not facing any issues right?

It is yes working fine now but after I edited the library files, I'm not sure if this is something that need to be addressed or am I missing a configuration somewhere.

@sacOO7
Copy link
Collaborator

sacOO7 commented Sep 20, 2024

Yeah, we will check and get back to you on this 👍

@Rajesh0078
Copy link

Still i am facing the same issue, can anyone solve this?

@sacOO7
Copy link
Collaborator

sacOO7 commented Sep 27, 2024

@Rajesh0078 can you try the solution mentioned by user @aliajami92 in first comment

@Rajesh0078
Copy link

not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants