hemanthrajv / flutter_compass

MIT License
102 stars 188 forks source link

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

Open yigit433 opened 5 months ago

yigit433 commented 5 months ago

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 commented 3 months ago

did you find a solution?

yigit433 commented 2 months ago

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

hissro commented 2 months ago

i just override the namespace and its working fine

koman96 commented 2 months ago

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

alestiago commented 2 months ago

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:fluttercompass.

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 commented 2 months ago

@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