0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

McAfeeのせいで react nativeがbuild出来ない 解決メモ

Last updated at Posted at 2018-10-29

McAfeeがReactNativeのデバッグ実行で使用する PORT8081を占有しちゃうため、
それを回避してバンドルを置いておかないといけないみたい。

まかふぃーを殺すのもいいけど、以下で解決しました。

参考文献

https://facebook.github.io/react-native/docs/troubleshooting
https://github.com/facebook/react-native/issues/10715

iOS

/node_modules/react-native/local-cli/server/server.js

default: process.env.RCT_METRO_PORT || 8081,
ここの8081のポート番号を、任意の番号に変更する

/node_modules/react-native/React/React.xcodeproj/project.pbxproj

8081を検索し、ポート番号にかかわる部分をすべて変更する。

ios/main.jsbundle

に書かれているlocalhost:8081を 変更

□xnodeで、info.plist > Allow Arbitrary Loads : YES
(なぜかcocoapodsのエラーでビルドできないので、iosのプロジェクトファイルがあるところで、
 pod installする。)

ios/Project内 AppDelegate.m

jscode位置を以下のように変更
(元の記述は残しておいてコメントアウトとかが良いかも)

jsCodeLocation = [NSURL URLWithString:@"http://192.168.2.100:8088/index.bundle?platform=ios&dev=true"];

android

androidは、buildした後に、
$ adb reverse tcp:8081 tcp:8088
を実行

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?