cybex-dev / twilio_voice

Flutter Twilio Voice Plugin
https://twilio-voice-web.web.app/
MIT License
39 stars 79 forks source link

not compatible with latest android gradle plugin (>= 8.x.x) #236

Open jd-bus opened 2 months ago

jd-bus commented 2 months ago

Issue Summary

1: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':twilio_voice'.
> 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/jd-bus/.pub-cache/hosted/pub.dev/twilio_voice-0.1.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.

Steps to Reproduce

  1. Use gradle-8.8-all.zip or any gradle above 8.x.x In android/gradle/wrapper/gradle-wrapper.properties:
    distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
  2. ./gradlew build
asshyy-ktz commented 1 month ago

After extensive configuration, I have successfully resolved the issue. Here are the steps taken:

1- Open the Android module in Android Studio. 2- Run the flutter clean command at the root level of your Flutter project. 3- Sync the Android project in Android Studio. 4- Modification in your project files: in-app level build.gradle

5- Go to setting.gradle set following versions for gradle and kotlin

6- Got to gradle-wrapper.properties and update distributionUrl with distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip

7- In module level build.gradle of twilio_voice

8- Sync the project again. 9- Clean the project once more and run the build. Happy debugging! If you have any questions, feel free to ask.

Summary: