0

C:\Users\omar\src\flutter.pub-cache\hosted\pub.dartlang.org\geolocator_android-3.0.1\android\src\main\java\com\baseflow\geolocator\location\LocationMapper.java:29: error: cannot find symbol if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { ^ symbol: variable S location: class VERSION_CODES C:\Users\omar\src\flutter.pub-cache\hosted\pub.dartlang.org\geolocator_android-3.0.1\android\src\main\java\com\baseflow\geolocator\location\LocationMapper.java:30: error: cannot find symbol position.put("is_mocked", location.isMock()); ^ symbol: method isMock() location: variable location of type Location 2 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':geolocator_android:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 1s Exception: Gradle task assembleDebug failed with exit code 1

1 Answers1

0

First thought

You could indeed try to use the general geolocator package, but this uses geolocator_android so it'll likely not solve your issue. You are already using the latest version of geolocator_android it seems.

Already asked before

Looking online for the error, your problem has actually been answered on SA already: Error in compilation with Geolocator pluggin

The Solution

The solution given is that you should update the compileSDKVersion in your build.gradle from 29 (or whatever it is now) to 31.

Alternatively you can probably also downgrade your version of the plugin.

fravolt
  • 2,565
  • 1
  • 4
  • 19