tlserver / flutter_map_location_marker

A flutter map plugin for displaying device current location.
https://pub.dev/packages/flutter_map_location_marker
BSD 3-Clause "New" or "Revised" License
97 stars 82 forks source link

Error: uses-sdk:minSdkVersion 19 cannot be smaller than version 20 #83

Closed jdevo2004 closed 9 months ago

jdevo2004 commented 9 months ago

I am_ having an error when implementing flutter_map_location_marker in my project. I am following the instructions here: https://pub.dev/packages/flutter_map_location_marker

I have added the depencancy flutter_map_location_marker: any and then imported it without problems. I have added import 'package:flutter_map_location_marker/flutter_map_location_marker.dart'; without problems I added CurrentLocationLayer(), under the tile layer without problems.

When I try to run the project there is the following error:

C:\Users\jdevo\henro_helper_real\android\app\src\debug\AndroidManifest.xml Error: uses-sdk:minSdkVersion 19 cannot be smaller than version 20 declared in library [:flutter_compass] C:\Users\jdevo\henro_helper_real\build\flutter_compass\intermediates\merged_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 19 Suggestion: use a compatible library with a minSdk of at most 19, or increase this project's minSdk version to at least 20, or use tools:overrideLibrary="com.hemanthraj.fluttercompass" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

I have tried for some time to troubleshoot this error and have changed the minSdk version but that also causes more errors. I assume this package does not require me to install the flutter_compass package but just in case I installed the latest flutter_compass but in doing so it just creates new errors. I have not had this type of error happen for other packages so I assume I am not doing anything wrong.

tlserver commented 9 months ago

Change the minSdkVersion from flutter.minSdkVersionin to 20 in your android/app/build.gradle (around line 50) should solve this problem.

jdevo2004 commented 9 months ago

Here is what my flutter.minSdkVersion looks like before:

image

Here is what it looks like after I change the minSdkVersion to 20

image

Here is the red error messages I get in the run console:

Running Gradle task 'assembleDebug'... Note: C:\Users\jdevo\AppData\Local\Pub\Cache\hosted\pub.dev\geolocator_android-4.2.4\android\src\main\java\com\baseflow\geolocator\location\LocationManagerClient.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

When I run my project I get the following error in big letters on the emulator: "Location Marker Plugin has not been Setup Correctly, Please follow the instructions in the documentation." This is a default error message that flutter_map_location_marker puts up when something is not right.

Here is my code:

image

tlserver commented 9 months ago

If you see "Location Marker Plugin has not been Setup Correctly, Please follow the instructions in the documentation.", that mean your permission in manifest is not setup correctly.