From fee93de54f64c54a063afbb41b7570391b511860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=9D=B0?= Date: Fri, 17 Mar 2023 13:45:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E4=B8=AD=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/android/build.gradle | 1 + .../geolocation/AMapGeolocationPackage.java | 25 +++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) 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