2016-07-23 98 views
0

我正在嘗試將Google Maps SDK添加到我的React Native項目中。React Native:添加Google Maps SDK

我正在關注official getting started guide並通過安裝SDK cocoapods。但pod install之後我無法啓動我的項目了:

Undefined symbols for architecture x86_64: 
    "std::terminate()", referenced from: 
     ___clang_call_terminate in libReact.a(RCTJSCExecutor.o) 
    "operator delete[](void*)", referenced from: 
     -[RCTJSCExecutor dealloc] in libReact.a(RCTJSCExecutor.o) 
     executeRandomAccessModule(RCTJSCExecutor*, unsigned int, unsigned long, unsigned long) in libReact.a(RCTJSCExecutor.o) 
     readRAMBundle(std::__1::unique_ptr<__sFILE, int (*)(__sFILE*)>, RandomAccessBundleData&) in libReact.a(RCTJSCExecutor.o) 
     RandomAccessBundleData::~RandomAccessBundleData() in libReact.a(RCTJSCExecutor.o) 
    "operator new[](unsigned long)", referenced from: 
     executeRandomAccessModule(RCTJSCExecutor*, unsigned int, unsigned long, unsigned long) in libReact.a(RCTJSCExecutor.o) 
     readRAMBundle(std::__1::unique_ptr<__sFILE, int (*)(__sFILE*)>, RandomAccessBundleData&) in libReact.a(RCTJSCExecutor.o) 
    "___cxa_begin_catch", referenced from: 
     ___clang_call_terminate in libReact.a(RCTJSCExecutor.o) 
    "___gxx_personality_v0", referenced from: 
     -[RCTJavaScriptContext initWithJSContext:onThread:] in libReact.a(RCTJSCExecutor.o) 
     -[RCTJavaScriptContext init] in libReact.a(RCTJSCExecutor.o) 
     -[RCTJavaScriptContext invalidate] in libReact.a(RCTJSCExecutor.o) 
     RCTNSErrorFromJSError(RCTJSCWrapper*, OpaqueJSContext const*, OpaqueJSValue const*) in libReact.a(RCTJSCExecutor.o) 
     +[RCTJSCExecutor runRunLoopThread] in libReact.a(RCTJSCExecutor.o) 
     -[RCTJSCExecutor init] in libReact.a(RCTJSCExecutor.o) 
     -[RCTJSCExecutor initWithUseCustomJSCLibrary:] in libReact.a(RCTJSCExecutor.o) 
     ... 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

** BUILD FAILED ** 


The following build commands failed: 
    Ld build/Build/Products/Debug-iphonesimulator/FooTests.xctest/FooTests normal x86_64 
(1 failure) 
/Users/admin/Desktop/Foo/node_modules/promise/lib/done.js:10 
     throw err; 
    ^

Error: xcodebuild process exited with code 65 
    at ChildProcess.xcodeBuildProcess.on.code (/Users/admin/Desktop/Foo/node_modules/react-native/local-cli/runIOS/runIOS.js:93:14) 
    at emitTwo (events.js:106:13) 
    at ChildProcess.emit (events.js:191:7) 
    at maybeClose (internal/child_process.js:852:16) 
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) 

已有人設法谷歌地圖SDK添加到本地做出反應的項目?

P.S.我看到this project,但它太舊了,我甚至無法運行它。

+1

去年我做到了。真讓人頭疼。我不得不手動添加一堆文件,通過堆棧跟蹤,並更改他們使用的一些宏(這會阻止你更新)等等等等等等。最終它並不值得。如果您可以只使用蘋果地圖或已經創建的組件來擴展自己的功能。對不起,這只是一些建議而已。 –

+0

感謝您的建議。我想我會放棄這個項目的React Native,並使用普通的Swfit/Obj-c。 – Edgar

回答

0

你可能只是使用the react-native-google-maps library解決這個沒有的CocoaPods,這是很容易集成和使用

+0

謝謝,我看到了這個lib,但它使用iOS上的Apple Maps ... Apple Maps不能像Google Maps那樣自定義樣式。這就是爲什麼我需要Google Maps .. – Edgar