howardweate avatar image
howardweate asked

OnMapReadyCallback and MapFragment.getMapAsync() class and method missing?

I'm using Android Studio, migrating an app from GoogleMaps APIv2 to Amazon Maps APIv2. No matter what I try, and MapFragment.getMapAsync() will not resolve and the compiler throws: Stacktrace: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; Compiler error: cannot find symbol class OnMapReadyCallback As per documentation I've: - installed Amazon Maps API v2 via SDK Manager - created Maven local repository and transferred .aar and .pom files - added Maven local repository as dependency in Project Structure Package build.gradle: allprojects { repositories { mavenCentral() mavenLocal() } } Module build.gradle: dependencies { compile '' } - renamed all Google namespaces and classes to Amazon equivalents. As a result, I have access to the package in my class. All fine: import; import; import; import; import; import; import; import; Won't resolve: import; Won't resolve: mapFragmentInstance.getMapAsync(); Support failed to understand the issue - can anyone shed any light on this?
amazon maps
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Ross@Amazon avatar image
Ross@Amazon answered
First download the most recent version of the Amazon Mobile App SDK here: Once you have extracted the Apps-SDK directory, navigate to Apps-SDK -> Android -> Maps -> 2.0 -> lib -> amazon-maps-api-v2_lib -> libs and add the jar files located in the libs directory to your project. When that is done add the following to your onCreate() method and build to verify that the methods you are trying to access are included with the Maps API: MapFragment mf = new MapFragment(); mf.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(AmazonMap amazonMap) { } });
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.