-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android按照readme里面的步骤集成后,调用getCurrentPosition报错 #124
Comments
根本原因在于APP启动的时候就报错: TypeError: null is not an object (evaluating 'AMapGeolocation.init')
init@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:160650:27
_callee$@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:191011:88
tryCatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:26933:23
invoke@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:27109:32
tryCatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:26933:23
invoke@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:27009:30
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:27019:21
tryCallOne@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:28871:16
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:28972:27
_callTimer@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:32411:17
_callImmediatesPass@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:32447:19
callImmediates@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:32665:33
callImmediates@[native code]
__callImmediates@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2730:35
http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2516:34
__guard@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2713:15
flushedQueue@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2515:21
flushedQueue@[native code]
invokeCallbackAndReturnFlushedQueue@[native code] |
同样的问题, `var react_native_1 = require("react-native"); function init(key) { 但是android端的module里面接口是
|
我尝试把react-native-amap-geolocation/lib/android/src/main/xxxxx/AMapGeolocationModule.java中的init接口修改了下,发现可以正常获取了,工程最好重新clean再编译一下。 `@ReactMethod
|
我按照你的方法试了一下,还是报这个错。 |
@chj-damon 你那init可以过去吗?我这按着文档导出 说没有_reactNativeAmapGxxxxx.init方法 |
过不去。还是在报错 |
@chj-damon 是啊 我iOS可以 安卓一直不能用 ,老版本的可以 这不升级后 用不了了 |
@chj-damon 解决了 必须用await !!! |
确实有问题 |
更新最新版就可以了 |
为了节省大家的时间,请尽可能详细地说明问题,并最好提供截图(特别是出错信息)。
报错信息:
RN 版本:0.62.2
react-native-amap-geolocation版本:1.1.0
The text was updated successfully, but these errors were encountered: