2017-12-28 25 views
0

React Native를 통합하려는 간단한 기본 iOS 앱이 있습니다.iOS의 React Native에서 BatchedBridge 오류가 발생했습니다.

# Uncomment the next line to define a global platform for your project 
# platform :ios, '9.0' 

target 'NativeRNTest' do 
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 
    use_frameworks! 

    pod 'React', :path => '../node_modules/react-native', :subspecs => [ 
    'Core', 
    'CxxBridge', # Include this for RN >= 0.47 
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43 
    'RCTText', 
    'RCTNetwork', 
    'RCTWebSocket', # needed for debugging 
    'BatchedBridge', 
    # Add any other subspecs you want to use in your project 
    ] 
    # Explicitly include Yoga if you are using RN >= 0.42.0 
    pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga" 

    # Third party deps podspec link 
    pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' 
    pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec' 
    pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' 

    # Pods for NativeRNTest 

    target 'NativeRNTestTests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

    target 'NativeRNTestUITests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

end 

내 환경 :

>react-native info 
Scanning folders for symlinks in /Users/[redacted]/Projects/native_rn_demo/node_modules (5ms) 

Environment: 

    OS: macOS Sierra 10.12.6 
    Node: 8.9.0 
    Yarn: 1.1.0 
    npm: 5.6.0 
    Watchman: 4.9.0 
    Xcode: Xcode 9.2 Build version 9C40b 
    Android Studio: 2.3 AI-162.4069837 

Packages: (wanted => installed) 
    react: ^16.0.0 => 16.0.0 
    react-native: ^0.51.0 => 0.51.0 

나는이 문제를 검색했고이 내 Podfile입니다

> Error calling RCTLog.logIfNoNativeHook 
> 
> Unhandled JS Exception: Could not get BatchedBridge, make sure your 
> bundle is packaged correctly 
> 
> RCTFatal 
> -[RCTCxxBridge handleError:] 
> __34-[RCTCxxBridge _initializeBridge:]_block_invoke facebook::react::RCTMessageThread::tryFunc(std::__1::function<void()> 
> const&) 
> facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void 
>()>&&)::$_1::operator()() const void 
> std::__1::__invoke_void_return_wrapper<void>::__call<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void 
>()>&&)::$_1&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void 
>()>&&)::$_1&&&) 
> std::__1::__function::__func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void 
>()>&&)::$_1, 
> std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void 
>()>&&)::$_1>, void()>::operator()() std::__1::function<void 
>()>::operator()() const invocation function for block in 
> facebook::react::RCTMessageThread::runAsync(std::__1::function<void 
>()>) 
> __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ 
> __CFRunLoopDoBlocks 
> __CFRunLoopRun CFRunLoopRunSpecific 
> +[RCTCxxBridge runRunLoop] 
> __NSThread__start__ 
> _pthread_body 
> _pthread_body thread_start 

: 내가보기 컨트롤러를 열 때 오류가 발생합니다 모든 솔루션은 Android 용이며 여기서는 작동하지 않습니다. 어떤 아이디어?

답변

0

그래, index.js의 이름을 index.ios.js으로 변경하여 오류를 수정했습니다.

+0

안녕하세요 @ Macondo2Seattle, 내 프로젝트를 RN 0.39에서 0.52 (예, 알겠습니다)로 업그레이드하는 중입니다. 위와 똑같은 문제가 발생합니다. RCTLog.logIfNoNativeHook을 호출하는 중 오류가 발생했습니다. 나는 index.js를 index.ios.js로 바꾸려고 시도했지만 어떤 것을 고치지는 않았다. 이 오류를 수정하기 위해 다른 방법을 사용 했습니까? 나는 그것에 관한 것을 발견 할 수 없다. 고마워요! –

+0

@GuillaumeS. 나는 동일한 자료를 가지고 있으며 모든 파일 index.js, index.android.js 및 index.ios.js를 가짐으로써이를 해결했습니다. 시도해보고 도움이된다면 의견을 말하십시오. – 6axter82

+0

@GuillaumeS. 파일 이름을 변경하는 것은 내가 기억하는 한 모두해야했습니다. – Macondo2Seattle