发表文章

[Java] RCTMGLMapView 不存在的 iOS v6.0. 0-alpha2 RCTMGLMapView does not exist for iOS v6.0.0-alpha2[react-native-mapbox-gl]

kevinsperrine 2017-10-9 74

我可以成功地构建和使用示例应用程序, 但当我尝试通过链接模块来集成自己的测试应用程序中的简单映射时, 生成成功完成, 但无法在 iOS 上运行, 因为地图没有正确构建。android 的版本很有用。你能给我指明正确的方向吗?

2017-10-04 23:16:29.765 [warn][tid:com.facebook.react.JavaScript] Warning: Native component for "RCTMGLMapView" does not exist
2017-10-04 23:16:29.767 [error][tid:com.facebook.react.JavaScript] undefined is not an object (evaluating 'MapboxGL.UserTrackingModes')
2017-10-04 23:16:29.769 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: undefined is not an object (evaluating 'MapboxGL.UserTrackingModes')
// using versions
buymore:aramis chuck$ node --version
v8.4.0
buymore:aramis chuck$ npm --version
5.3.0
buymore:aramis chuck$ yarn --version
1.1.0
buymore:aramis chuck$ react-native --version
react-native-cli: 2.0.1
react-native: 0.49.1
原文:

I can successfully build and use the example app, but when I attempt to integrate a simple map in my own test app by linking the module the build completes successfully, but fails to run on iOS because the MapView isn't building properly. The android version works great. Can you point me in the right direction here?

2017-10-04 23:16:29.765 [warn][tid:com.facebook.react.JavaScript] Warning: Native component for "RCTMGLMapView" does not exist
2017-10-04 23:16:29.767 [error][tid:com.facebook.react.JavaScript] undefined is not an object (evaluating 'MapboxGL.UserTrackingModes')
2017-10-04 23:16:29.769 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: undefined is not an object (evaluating 'MapboxGL.UserTrackingModes')
// using versions
buymore:aramis chuck$ node --version
v8.4.0
buymore:aramis chuck$ npm --version
5.3.0
buymore:aramis chuck$ yarn --version
1.1.0
buymore:aramis chuck$ react-native --version
react-native-cli: 2.0.1
react-native: 0.49.1
相关推荐
最新评论 (11)
nitaliano 2017-10-9
1

当我不链接 libRCTMGL 时, 我已经看到了这个错误. 在 "生成阶段" 下, v6 安装说明可能缺少此步骤我将在今天更新它。

原文:

I've seen that error when I don't link libRCTMGL.a under build phases, the v6 install instructions might be missing this step I'll update it today.

kevinsperrine 2017-10-9
2

谢谢, @nitaliano。当我添加 libRCTMGL. a 到链路二进制库生成阶段我现在在编译 CameraUpdateItem 时获取 RCTSource 类的重复接口定义的错误. m 和 MGLModule。

screenshot 2017-10-05 10 08 58

原文:

Thanks, @nitaliano. When I add libRCTMGL.a to the Link Binary with Libraries build phase I now get errors about a duplicate interface definition for the RCTSource class when compiling CameraUpdateItem.m and MGLModule.m.

screenshot 2017-10-05 10 08 58

nitaliano 2017-10-9
3

嗯, 你能把你链接到这个项目的所有内容都发布到屏幕上吗?我将运行在一个项目上再次设置它, 并看到如果我得到这个错误。

原文:

hmm would you be able to post a screen of everything you have linked to the project? I'll run through setting it up on a project again and seeing if I get this error.

kevinsperrine 2017-10-9
4

@nitaliano没错这是否足够?

screenshot 2017-10-05 11 22 29

# Package.json
{
  "name": "aramis",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "babel-core": "6.26.0",
    "babel-jest": "^21.2.0",
    "babel-preset-env": "^1.6.0",
    "babel-preset-react-native": "^4.0.0",
    "babel-preset-react-native-stage-0": "^1.0.1",
    "jest": "^21.2.1",
    "react-test-renderer": "^16.0.0"
  },
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "test": "jest"
  },
  "jest": {
    "preset": "react-native",
    "transform": {
      "^.+\\.js$": "babel-jest"
    },
    "transformIgnorePatterns": [
      "node_modules/(?!react-native|react-navigation)/"
    ]
  },
  "dependencies": {
    "@mapbox/react-native-mapbox-gl": "^6.0.0-alpha2",
    "prop-types": "^15.6.0",
    "react": "^16.0.0",
    "react-native": "^0.49.1",
    "react-navigation": "^1.0.0-beta.13"
  }
}
原文:

@nitaliano Sure thing. Is this sufficient?

screenshot 2017-10-05 11 22 29

# Package.json
{
  "name": "aramis",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "babel-core": "6.26.0",
    "babel-jest": "^21.2.0",
    "babel-preset-env": "^1.6.0",
    "babel-preset-react-native": "^4.0.0",
    "babel-preset-react-native-stage-0": "^1.0.1",
    "jest": "^21.2.1",
    "react-test-renderer": "^16.0.0"
  },
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "test": "jest"
  },
  "jest": {
    "preset": "react-native",
    "transform": {
      "^.+\\.js$": "babel-jest"
    },
    "transformIgnorePatterns": [
      "node_modules/(?!react-native|react-navigation)/"
    ]
  },
  "dependencies": {
    "@mapbox/react-native-mapbox-gl": "^6.0.0-alpha2",
    "prop-types": "^15.6.0",
    "react": "^16.0.0",
    "react-native": "^0.49.1",
    "react-navigation": "^1.0.0-beta.13"
  }
}
nitaliano 2017-10-9
5

@kevinsperrine

原文:

@kevinsperrine yes it is

kevinsperrine 2017-10-9
6

@nitalianoFWIW, 我可以用以下内容重新创建:

  1. 反应-本机 init mapboxtest
  2. 光盘 mapboxtest/
  3. 纱线添加 @mapbox/反应-mapbox-gl@6.0 0-alpha2
  4. 打开 ios/mapboxtest. xcodeproj
  5. 如果需要, 将 node_modules/@mapbox/react-native-mapbox-gl/ios/Mapbox.framework 添加到嵌入的二进制文件 (w/复制项目)
  6. node_modules/@mapbox/react-native-mapbox-gl/ios/RCTMGL.xcodeproj 添加到库
  7. $(PROJECT_DIR)/../node_modules/@mapbox/react-native-mapbox-gl/ios 添加到框架搜索路径
  8. 添加新的运行脚本生成阶段, 其中包含bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework/strip-frameworks.sh"
  9. libRCTMGL.a 添加到 Link Binary with Libraries 生成阶段
  10. 尝试在模拟器上生成和运行该项目。
原文:

@nitaliano FWIW, I can recreate this with:

  1. react-native init mapboxtest
  2. cd mapboxtest/
  3. yarn add @mapbox/react-native-mapbox-gl@6.0.0-alpha2
  4. open ios/mapboxtest.xcodeproj
  5. add node_modules/@mapbox/react-native-mapbox-gl/ios/Mapbox.framework to Embedded Binaries w/ Copy items if needed
  6. add node_modules/@mapbox/react-native-mapbox-gl/ios/RCTMGL.xcodeproj to the Libraries
  7. add $(PROJECT_DIR)/../node_modules/@mapbox/react-native-mapbox-gl/ios to the framework search paths
  8. add a new run script build phase containing bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework/strip-frameworks.sh"
  9. add libRCTMGL.a to the Link Binary with Libraries Build Phase
  10. Attempt to build and run the project on simulator.
frankrowe 2017-10-9
7

我能够得到它建立在 iOS 上的链接libRCTMGL.a

原文:

I was able to get it to build on iOS by linking libRCTMGL.a

kevinsperrine 2017-10-9
8

@frankrowe谢谢.在深入挖掘时, 它看起来像是在版本 0.49中将 RCTSource 添加到内核中。我也能够得到 iOS 编译后, 下降的反应-本机回版本0.48。4

cc @nitaliano

原文:

@frankrowe Thanks. In digging deeper, it looks like react-native added a RCTSource into core on version 0.49. I too was able to get iOS to compile after dropping react-native back to version 0.48.4

cc @nitaliano

nitaliano 2017-10-9
9

@kevinsperrine ha, 很好还有一个名为 RCTLayer 我将遍历它们并将它们命名为和的类 RCTMGlLayer RCTMGLSource 。谢谢你的挖掘!

今天晚些时候我将向 npm 发布一个新版本

原文:

@kevinsperrine ha, great there's also a class called RCTLayer I'll go through and namespace them to RCTMGlLayer and RCTMGLSource. Thanks for digging into this!

I'll publish a new version to npm later today

kevinsperrine 2017-10-9
10

谢谢, @nitaliano。干得好!我真的很兴奋 v6 重写。

原文:

Thanks, @nitaliano. Great work on this! I'm really excited about this v6 rewrite.

nitaliano 2017-10-9
11

@kevinsperrine我只是将更改推送到 v6 , 更新了示例应用程序以使用 RN 0.49 并发布 @mapbox/react-native-mapbox-gl@6.0.0-alpha3 到 npm。

我将关闭此问题, 如果遇到任何问题, 请随意创建另一个问题

原文:

@kevinsperrine I just pushed the changes to v6, updated the example app to use RN 0.49 and published @mapbox/react-native-mapbox-gl@6.0.0-alpha3 to npm.

I'm going to close this issue out, feel free to create another issue if you run into any problems

返回
发表文章
kevinsperrine
文章数
1
评论数
5
注册排名
60750