diff --git a/lib/android/build.gradle b/lib/android/build.gradle index e87c2e1..43e70aa 100644 --- a/lib/android/build.gradle +++ b/lib/android/build.gradle @@ -11,5 +11,6 @@ android { dependencies { compileOnly 'com.facebook.react:react-native:+' + compileOnly "org.jetbrains:annotations:23.0.0" implementation 'com.amap.api:location:6.2.0' } diff --git a/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java b/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java index 608e84b..5f88400 100644 --- a/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java +++ b/lib/android/src/main/java/cn/qiuxiang/react/geolocation/AMapGeolocationPackage.java @@ -6,19 +6,24 @@ import com.facebook.react.uimanager.ViewManager; import org.jetbrains.annotations.NotNull; +import java.util.ArrayList; import java.util.Collections; import java.util.List; public class AMapGeolocationPackage implements ReactPackage { - @NotNull - @Override - public List createViewManagers(@NotNull ReactApplicationContext reactContext) { - return Collections.emptyList(); - } +@NotNull +@Override +public List createViewManagers(@NotNull ReactApplicationContext reactContext) { +return Collections.emptyList(); +} - @NotNull - @Override - public List createNativeModules(@NotNull ReactApplicationContext reactContext) { - return Collections.singletonList(new AMapGeolocationModule(reactContext)); - } +@NotNull +@Override +public List createNativeModules(@NotNull ReactApplicationContext reactContext) { + + List modules = new ArrayList<>(); + modules.add(new AMapGeolocationModule(reactContext)); + + return modules; +} } \ No newline at end of file