See this question because it's very relevant. Note: this question doesn't provide a sufficient answer, but the answer to the reference mentions the MainActivity.java-file and how it works with the GeneratedPluginRegistrant.java-file.
I'm trying to find location based on coordinates, but when doing flutter run
with Chrome debugging, I get this error:
Error: MissingPluginException(No implementation found for method placemarkFromCoordinates on channel
flutter.baseflow.com/geocoding)
Following the link of the aforementioned link, I believe there's something wrong with my MainActivity.kt file, which is empty (default). There's a generated file called GeneratedPluginRegistrant.java with this code:
public final class GeneratedPluginRegistrant {
private static final String TAG = "GeneratedPluginRegistrant";
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
try {
flutterEngine.getPlugins().add(new com.baseflow.geocoding.GeocodingPlugin());
} catch(Exception e) {
Log.e(TAG, "Error registering plugin geocoding, com.baseflow.geocoding.GeocodingPlugin", e);
}
try {
flutterEngine.getPlugins().add(new com.baseflow.geolocator.GeolocatorPlugin());
} catch(Exception e) {
Log.e(TAG, "Error registering plugin geolocator, com.baseflow.geolocator.GeolocatorPlugin", e);
}
}
}
How can I make the MainActivity.kt file reference this code? Or is there a separate solution?