1. Foreword
Plug in amap in use_ The location suddenly reported an error today. The project cannot run. The error prompt is as follows:
2. Error prompt
.../amaplocation/AmapLocationPlugin.java:287:Error: Unreported exception error Exception; it must be caught or declared in order to throw locationClient = new AMapLocationClient(getApplicationContext());
3. Cause investigation
After modifying the one-to-one communication without results and one-to-one search for information, I accidentally saw the discussion in the group and knew that it was caused by the problem of privacy policy. The temporary solution is not to use the latest Gaode com.amap.api: location. The latest privacy policy is available. The best solution should be to access the latest policy, which has not been implemented
4. Solution
1. Find AutoNavi’s amap_location package according to the above path, in flutter/.pub-cache/hosted/…, and copy it after getting it, and change the latest dependency in android/build.gradle. At present, I Here is changed to 5.5.1
2. Delete the example in the package, create the local plug-in file plugins in the project, put the plug-in package into yaml, and import the local plug-in
Execute pub get, the error disappears, and the project can run
Read More:
- Unable to find bundled Java version =>Mac Flutter [Android Studio Arctic Fox 2020.3.1]
- flutter, Unable to buy item, Error response code: 7 & flutter_inapp_purchase
- [Solved] Flutter package flutter build apk Error: permission-handle
- Flutter flutter doctor –android-licenses [How to Solve]
- [Solved] the SDK location is inside Studio‘s install location
- [Solved] Flutter compile error: Failed to find Build Tools revision 29.0.2
- [Solved] Flutter – AAPT: error: resource android:attr/dialogCornerRadius not found.
- Flutter android studio runs gradle build error: Could not resolve all artifacts for configuration’:classpath’.
- [Solved] Flutter Error: fluwx:compileDebugKotlin
- flutter | W/zipro(12512): Error opening archive D:\…Invalid file ERROR: dump failed because…
- Flutter Package error: keyboard_visibility:verifyReleaseResources
- [Easy Solution] flutter Run Error: library “libflutter.so“ not found
- [Solved] Android Studio Error:SDK location not found.
- flutter doctor –android-licenses error [How to Solve]
- [Solved] Flutter Error: No MediaQuery widget ancestor found.
- How to Solve Project Upgrade to flutter2.5.0 Error
- VScode: How to Solve golong plug-in install Error
- How to Solve screenfull plug-in Error (Version Issues)
- [Solved] The invalidation of windows.location.txt on Android mobile phone
- Flutter Xcode Module not found or LibreSSL SSL_connect: SSL_ERROR_SYSCALL