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

A problem occurred configuring project ':flutter_compass'. #110

Open
yigit433 opened this issue Jun 25, 2024 · 6 comments
Open

A problem occurred configuring project ':flutter_compass'. #110

yigit433 opened this issue Jun 25, 2024 · 6 comments

Comments

@yigit433
Copy link

The error message I receive is as follows. Can you help me?

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':flutter_compass'.
> 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.   

     If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Failed to query the value of property 'buildFlowServiceProperty'.
> Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@1815d0fe of type BuildFlowService.Parameters
   > A problem occurred configuring project ':flutter_compass'.
      > 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.

           If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

* 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.
==============================================================================

BU�LD FAILED in 1s
Running Gradle task 'assembleDebug'...                           2.192ms
Error: Gradle task assembleDebug failed with exit code 1
@ElbariguiAdam
Copy link

did you find a solution?

@yigit433
Copy link
Author

I had to delete the library because I couldn't find the solution.

@hissro
Copy link

hissro commented Sep 25, 2024

i just override the namespace and its working fine

@koman96
Copy link

koman96 commented Sep 26, 2024

@hissro
could you show how to do this override step, plz ?

@alestiago
Copy link

alestiago commented Sep 27, 2024

I believe you need to add the namespace to the android directory flutter_compass uses , not your main application directory. In other words you'll have to modify your local .pub-cache file for the package:flutter_compass.

Either that or consider using another AGP version.

Nonetheless, this should be resolved by the package maintainers or contributors, I think https://github.com/hemanthrajv/flutter_compass/pull/113/files is doing precisely that.

@hissro
Copy link

hissro commented Sep 27, 2024

@koman96 there many way to fix this error:
A:

  1. you simply edit on flutter_compass directly from the path
    C:\Users\User\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_compass-0.8.0\android.
  2. then add inside android tag :
    namespace = "com.hemanthraj.fluttercompass"
1

B: there second way by adding dependency_overrides for flutter_compass
now you can run and build your app.

regards

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

5 participants