J1aDong / Fleet

a react native app about fleet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fleet

a react native app about fleet

环境

  • macOS 10.12
  • Android Studio 2.2.2
  • WebStorm 2016.2.4
  • Xcode 8.0
  • react-native 0.35.0

安装&运行

  • 参照官网先搭建好react-native的开发环境,确保能顺利运行hello world
  • git clone
  • 在根目录下命令行 npm install
  • 在ios目录下命令行 pod install
  • 在根目录下命令行 react-native link
  • 运行ios版本 在根目录下命令行 react-native run-ios
  • 运行android版本 在根目录下命令行 react-native run-android

参考资料

碰到的问题&对策

###ipad实机没法启动hot reloading来动态进行调试

在ios源码的AppDelegate.m中的jsCodeLocation改为jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.5:8081/index.ios.bundle?platform=ios&dev=true"];(注意ip对应自己的机子),并且在info.list中的App Transport Security Settings下添加Allow Arbitrary Loads为YES,确保能加载http的数据

安卓上的场景转换特别卡

1.注意不要开启chrome调试 2.生成release版本,再安装到手机上,会很流畅

有时候提示找不到依赖的第三方包,暂时无从下手

参考链接

mqtt库报错'MQTTClient/MQTTClient.h' file not found

参考链接

was built for newer is version () then being is linked () 的警告

参考链接

Error:Execution failed for task ':app:transformClassesWithDexForDebug

参考链接

使用的第三方库

打包

安卓

  • 在webstorm中运行 react-native bundle --entry-file index.android.js --bundle-output ./android/app/src/main/assets/index.android.jsbundle --platform android --assets-dest ./android/app/src/main/res/ --dev false
  • 在MainApplication中添加protected String getBundleAssetName() { return "index.android.jsbundle"; }

iOS

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];的注释打开

About

a react native app about fleet

License:Apache License 2.0


Languages

Language:JavaScript 77.5%Language:Objective-C 10.9%Language:Java 9.2%Language:Python 2.3%Language:Ruby 0.1%