flutter / samples

A collection of Flutter examples and demos
https://flutter.github.io/samples/
Other
17.26k stars 7.53k forks source link

[add-to-app/books] - 'maven' was added by plugin class 'FlutterPlugin' #1717

Closed derek-alves closed 1 year ago

derek-alves commented 1 year ago

I'm trying to follow pigeon's add_to_app(books) example, but I'm getting this error:

Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by plugin class 'FlutterPlugin'

XHZ360 commented 1 year ago

same issue https://github.com/flutter/flutter/issues/101347

I do this to solve it

build.gradle: allprojects { repositories { google() jcenter() } }

settings.gradle dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.PREFER_PROJECT) //origin: RepositoriesMode.FAIL_ON_PROJECT_REPOS repositories { google() mavenCentral() jcenter() } }

domesticmouse commented 1 year ago

@XHZ360 can you put that change into a PR please?