RodrigoSMarques / flutter_branch_sdk

Flutter Plugin for create deep link using Branch Metrics SDK. This plugin provides a cross-platform (iOS, Android, Web).
https://branch.io
MIT License
100 stars 90 forks source link

A problem occurred configuring project ':flutter_branch_sdk'. #256

Closed heshesh2010 closed 1 year ago

heshesh2010 commented 1 year ago

run on new version 7.0.0 with android

FAILURE: Build failed with an exception.

RodrigoSMarques commented 1 year ago

Does this occur on a new project or are you updating an existing project?

Did you read the instructions in the link provided?

crobinsonpicdmo commented 1 year ago

@RodrigoSMarques I have the same problem. As of AGP 8+ you must set the namespace in the android {} section of build.gradle. I believe if it's added to the Branch build.gradle it will resolve our issues. https://issuetracker.google.com/issues/200682321 https://developer.android.com/build/configure-app-module#set-namespace

Here's an example of a plugin with support for the namespace: https://github.com/firebase/flutterfire/blob/master/packages/firebase_core/firebase_core/android/build.gradle

chadpav commented 1 year ago

After manually updating this package and several others I can confirm that supporting AGP 8+ is the correct solution. I guess all flutter packages are hitting this at the same time. In order to compile against SDK 34 I had to go to AGP 8.

I added this code to the build.gradle file:

android {
    // Conditional for compatibility with AGP <4.2.
    if (project.android.hasProperty("namespace")) {
      namespace 'br.com.rsmarques.flutter_branch_sdk'
    }
...
}
RodrigoSMarques commented 1 year ago

@chadpav and @crobinsonpicdmo.

Thank you for the informations.

In addition to including build.gradle, checking changes made to other plugins, there are other changes to be made.

I am mapping out what needs to be done and will make a new version available in the next few days.

messinis commented 1 year ago

Same issue here.

RodrigoSMarques commented 1 year ago

Resolved in version 7.0.1