How Do I Create A Path In The pubspec.yaml File?

39 views Asked by At

While building an App, I came across an error:

enter image description here

I'm guessing the error was saying I needed to update the location package in order to use it. While researching how to update the package, I came across this website :

https://www.fluttercampus.com/guide/391/android-gradle-plugin-supports-only-kotlin-gradle-plugin-version-and-heigher/

It basically said in order to update the kotlin grade plugin version, I would have to change the ext.kotlin_version's number in the package's android/build.gradle file then create a path to the file in pubspec.yaml. I made the proper changes to location package like the website said, but the problem came when I tried creating a path to the file:

enter image description here

Is this even allowed? The website said to create a link straight from your computer's downloads file but Flutter isn't letting me. Are version numbers like "1.1.1" the only thing that can be accepted? I tried getting rid of the path: but that didn't work. A little help would be appreciated.

1

There are 1 answers

15
Chamalka Gunawardana On

This happens because Communities has not developed a stable version of the location package that matches the location package with your kotlin version. Because of that, temporary solution can be proposed. Specify the location package in your pubspec.yaml file like this. this is working for me.

replaced

location: ^4.4.0

with this in pubspec.yaml and ran flutter pub get

location:
git:
  url: https://github.com/781flyingdutchman/flutterlocation.git
  ref: 'V4'
  path: packages/location

I hope this is fixed in v4 by the maintainer of this extension soon.