Skip to content

在RN 0.25中报告错误,同时RN的api应该是变了。 #13

@bluebird88

Description

@bluebird88

MainActivity中注册变成了:

protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),new BaiduMapReactPackage(this)
    );
}

编译过程中显示一大堆unknown source,类似:

Unknown source file : warning: Ignoring InnerClasses attribute for an anonymous inner class
Unknown source file : (com.baidu.platform.comapi.b) that doesn't come with an
Unknown source file : associated EnclosingMethod attribute. This class was probably produced by a
Unknown source file : compiler that did not target the modern .class file format. The recommended
Unknown source file : solution is to recompile the class from source, using an up-to-date compiler
Unknown source file : and without specifying any "-target" type options. The consequence of ignoring 。。。。。
,最后编译完毕,部署到真机或者模拟器,点击都会立即显示应用无法响应;logcat中显示一大堆错误,其中一个好像是初始化过程中的错误:

05-11 15:19:14.857: I/ReactNativeJS(18155): Running application "MyProject" with appParams: {"initialProps":{},"rootTag":1}. DEV === true, development-level warning are ON, performance optimizations are OFF
05-11 15:19:14.879: W/ReactNativeJS(18155): Warning: ReactNative.createElement is deprecated. Use React.createElement from the "react" package instead.
05-11 15:19:14.901: E/unknown:React(18155): Exception in native call from JS
05-11 15:19:14.901: E/unknown:React(18155): java.lang.IllegalStateException: you have not supplyed the global app context info from SDKInitializer.initialize(Context) function.
05-11 15:19:14.901: E/unknown:React(18155): at com.baidu.platform.comapi.a.b(Unknown Source)
05-11 15:19:14.901: E/unknown:React(18155): at com.baidu.mapapi.BMapManager.init(Unknown Source)
05-11 15:19:14.901: E/unknown:React(18155): at com.baidu.mapapi.map.MapView.a(Unknown Source)
05-11 15:19:14.901: E/unknown:React(18155): at com.baidu.mapapi.map.MapView.(Unknown Source)
05-11 15:19:14.901: E/unknown:React(18155): at com.bee.baidumapview.BaiduMapViewManager.createViewInstance(BaiduMapViewManager.java:112)
05-11 15:19:14.901: E/unknown:React(18155): at com.bee.baidumapview.BaiduMapViewManager.createViewInstance(BaiduMapViewManager.java:19)
05-11 15:19:14.901: E/unknown:React(18155): at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:44)
05-11 15:19:14.901: E/unknown:React(18155): at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManag

后边显示:
05-11 15:19:14.974: E/AndroidRuntime(18155): FATAL EXCEPTION: mqt_native_modules

代码是你的样例程序,不知道什么问题;
你能验证一下吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions