aloisdeniel / flutter_geocoder

Flutter plugin for forward and reverse geocoding
MIT License
186 stars 174 forks source link

flutter_geocoder has been deprecated, need to update as per latest flutter version #76

Open kamleshwebtech opened 3 years ago

kamleshwebtech commented 3 years ago

Getting below error in console panel:

The plugins `flutter_geocoder` use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.

Need to update flutter_geocoder plugin as per latest flutter version. Thanks.

nguyenxdat commented 3 years ago

Getting below error in console panel:

The plugins `flutter_geocoder` use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.

Need to update flutter_geocoder plugin as per latest flutter version. Thanks.

Please use this repo => https://github.com/nguyenxdat/flutter_geocoder

zakblacki commented 3 years ago

Getting below error in console panel:

The plugins `flutter_geocoder` use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.

Need to update flutter_geocoder plugin as per latest flutter version. Thanks.

Please use this repo => https://github.com/nguyenxdat/flutter_geocoder

How do I call this on my pubspec ?

nguyenxdat commented 3 years ago

Getting below error in console panel:

The plugins `flutter_geocoder` use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.

Need to update flutter_geocoder plugin as per latest flutter version. Thanks.

Please use this repo => https://github.com/nguyenxdat/flutter_geocoder

How do I call this on my pubspec ?

Use this

geocoder: git: url: https://github.com/nguyenxdat/flutter_geocoder.git ref: master

zakblacki commented 3 years ago

Unfortunately though it does fix the warning it does not work as intended so I wouldn't recommend this

AleksandarSavic95 commented 3 years ago

@zakblacki are you getting these errors?

/Users/alex/.pub-cache/git/flutter_geocoder-07a69e6a28e3dda194e5239e378e1ba960bfba95/android/src/main/java/com/aloisdeniel/geocoder/GeocoderPlugin.java:87: error: lambda expressions are not supported in -source 1.7
                    () -> methodResult.success(result));
                       ^
  (use -source 8 or higher to enable lambda expressions)

/Users/alex/.pub-cache/git/flutter_geocoder-07a69e6a28e3dda194e5239e378e1ba960bfba95/android/src/main/java/com/aloisdeniel/geocoder/GeocoderPlugin.java:100: error: method references are not supported in -source 1.7
                    methodResult::notImplemented);
                                  ^
  (use -source 8 or higher to enable method references)
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':geocoder:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
nguyenxdat commented 3 years ago

Unfortunately though it does fix the warning it does not work as intended so I wouldn't recommend this

Sorry my mistake. I pushed new code and it's work

nguyenxdat commented 3 years ago

@zakblacki are you getting these errors?

/Users/alex/.pub-cache/git/flutter_geocoder-07a69e6a28e3dda194e5239e378e1ba960bfba95/android/src/main/java/com/aloisdeniel/geocoder/GeocoderPlugin.java:87: error: lambda expressions are not supported in -source 1.7
                    () -> methodResult.success(result));
                       ^
  (use -source 8 or higher to enable lambda expressions)

/Users/alex/.pub-cache/git/flutter_geocoder-07a69e6a28e3dda194e5239e378e1ba960bfba95/android/src/main/java/com/aloisdeniel/geocoder/GeocoderPlugin.java:100: error: method references are not supported in -source 1.7
                    methodResult::notImplemented);
                                  ^
  (use -source 8 or higher to enable method references)
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':geocoder:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

You should use java version 8 and above

zakblacki commented 3 years ago

Yes thank you it's working as expected !

AleksandarSavic95 commented 3 years ago

You should use java version 8 and above

Where should I update java to version 8? @nguyenxdat

zakblacki commented 3 years ago

You should use java version 8 and above

Where should I update java to version 8? @nguyenxdat

on your build.gradle app put jdk8 instead of 7 also update your java on ide settings

AleksandarSavic95 commented 3 years ago

Thanks, will try next week, with some other package updates :))

krupa-inheritx commented 2 years ago

I have added below lines in gradle compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } But still getting same error of lambda expression. @nguyenxdat

nguyenxdat commented 2 years ago

I have added below lines in gradle compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } But still getting same error of lambda expression. @nguyenxdat

Check java version in your PC

krupa-inheritx commented 2 years ago

I have Java 11 installed in my PC @nguyenxdat

TharaniP commented 2 years ago

After updating flutter to 2.5.2 version getting the below error:

The plugin geocoder uses a deprecated version of the Android embedding. To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs. If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

Please update the package according to the new flutter version. It will be really helpful.

zakblacki commented 2 years ago

Getting below error in console panel:

The plugins `flutter_geocoder` use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.

Need to update flutter_geocoder plugin as per latest flutter version. Thanks.

Please use this repo => https://github.com/nguyenxdat/flutter_geocoder

How do I call this on my pubspec ?

Use this

geocoder: git: url: https://github.com/nguyenxdat/flutter_geocoder.git ref: master

Please consider adding it as on pub.dev if this does not get any more update

klivin commented 2 years ago

just a comment to fix the java compatibility problem, I needed to edit the android build.gradle of the @nguyenxdat fork, not in my own project. @nguyenxdat it would be nice if you added this commit to your project.

nguyenxdat commented 2 years ago

I have new commit, please change from geocoder: git: url: https://github.com/nguyenxdat/flutter_geocoder.git ref: master to geocoder: git: url: https://github.com/nguyenxdat/flutter_geocoder.git ref: 443b875d8ec80ce525cc6e8f17dfbbbbe7fa3028

ShivamMattoo33 commented 2 years ago

Hi @nguyenxdat This seems to be working Is there a reason why you havent published a package on pub dev instead of us forking considering that this package hasnt been updated for almost a year