2016-03-23 5 views
1

EDITを見つけることができません:それは私が私のReactNativeアプリ上__fbBatchedBridgeエラーを取得しています今、Android上でにReferenceError:変数__fbBatchedBridgeに

を開発しています注目に値します。この問題は、パッケージャへの接続に失敗したことではありません(その証拠は以下のとおりです)。テスト用のパッケージをたくさんインストールしたときに問題が発生しましたが、復帰してもnode_modulesが削除されても、npm installが残っています。

package.json

{ 
    "name": "MyApp", 
    "version": "0.0.1", 
    "private": true, 
    "scripts": { 
    "start": "node node_modules/react-native/local-cli/cli.js start", 
    "log": "adb logcat *:S ReactNative:V ReactNativeJS:V" 
    }, 
    "dependencies": { 
    "events": "^1.1.0", 
    "react-native": "^0.18.0", 
    "react-native-push-notification": "^1.0.2", 
    "react-native-scrollable-tab-view": "^0.3.5", 
    "react-native-webrtc": "^0.2.7", 
    "react-redux": "^4.4.0", 
    "redux": "^3.3.1", 
    "socket.io-client": "^1.4.4" 
    }, 
    "devDependencies": { 
    "redux-devtools": "^3.1.1" 
    } 
} 

NPM開始は

[7:19:50 PM] <START> Building Dependency Graph 
[7:19:50 PM] <START> Crawling File System 
[7:19:50 PM] <START> Loading bundles layout 
[7:19:50 PM] <END> Loading bundles layout (0ms) 

React packager ready. 

[7:19:53 PM] <START> request:/index.android.bundle?platform=android&dev=true 
[7:19:53 PM] <START> find dependencies 
[7:19:56 PM] <END> Crawling File System (5686ms) 
[7:19:56 PM] <START> Building in-memory fs for JavaScript 
[7:19:56 PM] <END> Building in-memory fs for JavaScript (346ms) 
[7:19:56 PM] <START> Building in-memory fs for Assets 
[7:19:56 PM] <END> Building in-memory fs for Assets (322ms) 
[7:19:56 PM] <START> Building Haste Map 
[7:19:56 PM] <START> Building (deprecated) Asset Map 
[7:19:57 PM] <END> Building (deprecated) Asset Map (87ms) 
[7:19:57 PM] <END> Building Haste Map (452ms) 
[7:19:57 PM] <END> Building Dependency Graph (6811ms) 
[7:19:57 PM] <END> find dependencies (4018ms) 
[7:19:57 PM] <START> transform 
transforming [========================================] 100% 549/549 
[7:20:00 PM] <END> transform (3417ms) 
[7:20:00 PM] <END> request:/index.android.bundle?platform=android&dev=true (7463ms) 

あなたが見ることができるように、パッケージャ梱包され、その後上げているGenymotionにバンドルを送信する結果エラー。

+0

対応するネイティブのバージョンは、iosとjavascriptで一致しますか? – everlasto

+0

私はAndroid用に開発中ですが、はい。 – wmjbyatt

答えて

1

この問題は、新しいバージョンのReact Nativeで修正されています。あなたのバージョンを0.22にアップグレードしてください。

あなたはAppDelegate.mファイルで

# if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then   
#  echo "Skipping bundling for Simulator platform"  
#  exit 0;  
# fi 
+0

React Nativeをアップグレードしました。ありがとうございました。 – wmjbyatt

0

if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then 
    echo "Skipping bundling for Simulator platform" 
    exit 0; 
fi 

を交換node_modules/react-native/packager/packager.sh

よりも一時的な修正を探している場合は、私たちが使用します:

jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; 
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 

代わりに、を使用します。端末から

0

adb shell input keyevent 82

GenymotionはDEVメニューを開き、次にDevの設定

に行く:adb shell input text <your IPv4 adress>:8081

そして最後に:

adb reverse tcp:8081 tcp:8081

+0

私はすでにパッケージャにうまく接続していると言っています – wmjbyatt

関連する問題