flutter-webrtc / callkeep

iOS CallKit and Android ConnectionService for Flutter
MIT License
131 stars 142 forks source link

Android build failed - Namespace not specified #186

Open kouz75 opened 1 month ago

kouz75 commented 1 month ago

Hi,

I try to build my project for Android. (with gradle 8.x) Build failed with the message : A problem occurred configuring project ':callkeep'.

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: /Users/xxx/.pub-cache/hosted/pub.dev/callkeep-0.3.3/android/build.gradle. 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.

any idea on how to fix it ?

moazh commented 1 month ago

To address the issue, add the following code to the CallKeep project's Gradle configuration. If you have a custom CI/CD workflow that builds the application in the cloud, you may need to fork the project and create your own version until the changes are merged into the library. android { if (project.android.hasProperty("namespace")) { namespace "com.github.cloudwebrtc.flutter_callkeep" } }