Open ZhengXingchi opened 4 years ago
React/RCTBridgeModule.h
file not foundReact/RCTBridgeModule.h
file not found
“RCTBundleURLProvider.h” file not found - AppDelegate.m
报错
DevTools v4 is incompatible with this version of React
Either upgrade React or install React DevTools v3
npm install -d react-devtools@^3
安装低版本的react-native-debugger就好了 参考react-devtools agent got no connection in react native with expo
打开"RCTWebSocketExecutor.m"文件,将“localhost”改为你的电脑的ip,然后在developer menu下单击debug js remotely启动js远程调试功能
方式一
在Android5.0以上设备上,将手机通过usb连接到你的电脑,然后通过adb命令行工具运行如下命令来设置端口转发
adb reverse tcp:8081 tcp:8081
方式二 通过摇一摇打开developer menu 下面的Dev Settings中设置你的电脑ip来进行调试
在使用真机调试时,你需要确保你的手机和电脑处在同一个网段内,即它们实在同一个路由器下面
react-native : 0.57.8
i solved the problem
change the file node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 42 line as below
if (
!version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') &&
!version.startsWith('com.apple.CoreSimulator.SimRuntime.tvOS')
) {
continue;
}
change the file node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 56 line as below
if (!simulator.isAvailable) {
continue;
}
启动页
ios配置在
./ios/[项目名]/Images.xcassets/aunchImage.launchimage/Contetents.json
android在
/android/app/src/main/res
目录下 一堆drawable目录,替换掉以下相应目录中的launcher_screen.png就可以了。 注意如果删掉图片会报错是因为在同目录下layout/launch_screen.xml
的有引用删除
android:background="@drawable/launch_screen"
即可桌面图标
ios配置在
./ios/[项目名]/Images.xcassets/AppIcon.appiconset/Contetents.json
android在
/android/app/src/main/res
目录下 一堆mipmap目录,替换掉以下相应目录中的ic_launcher.png就可以了。 注意如果删掉图片会报错是因为在android/app/src/main/AndroidManifest.xml
中有引用将
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
删去即可桌面名称
ios配置在
./ios/cgjApp.xcodeproj/project.pbxproj
android 一般Android在打包的时候,如果没经过修改,那么应用显示的名称就是我们在react-native init时设定的名称,这肯定不是我们需要的,那么,如何修改呢?
挺简单的,我们打开项目的
android/app/src/main/AndroidManifest.xml
文件可以看到名称的设定:android:label="@string/app_name"
这说明app的显示名称在
@string/app_name
中进行了设定。 那我们直接继续打开android/app/src/main/res/values/strings.xml,即可看到配置中的app_name,修改为你想要的即可,如:参考文献
React Native 添加图标和启动屏(完美适配各种屏幕)
react-native 配置启动图支持ios和android