@chengxuyuan
2023-05-17T06:06:27.000000Z
字数 4695
阅读 1246
橙旭园公司
conda config --set auto_activate_base false 关闭conda config --set auto_activate_base true 打开/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install nodebrew install watchman react native 依赖库sudo gem install cocoapodsnpm installnpm install 出错时 could not resolve dependency peer react 终端执行npm config set legacy-peer-deps true 再npm installcd ./ios 在项目ios文件夹下 执行 pod installpod install 出错时,以Rosetta形式打开终端,安装sudo gem install ffi,后pod installbrew install --cask adoptopenjdk/openjdk/adoptopenjdk8
https://developer.android.com/studio (一路next即可) Configure-> SDK Manager 或者 More Actions -> SDK Manager,SDK Platforms 额外安装其他版本 show package details, 可以看具体Sdk下的相关库SDK Tools 同 SDK platformsproductproduct -> Archive -> Distribute App->Ad hoc 测试包product -> Archive -> Distribute App -> App Store Connect 发布包问题1 在 Locating and createing signing assets界面 communicating with Apple一直转圈,可以尝试重启Xcode,切换网络或重启电脑问题2 CxyLiveClass橙旭园课堂,打包后图片资源不显示,参考这个链接, 先把新增的图片添加到src/images/assets,然后再把它添加进去问题3 CxyLiveClass橙旭园课堂 打包后源代码没有更新,参考链接, 每次打包前先删除./ios/CxyLiveClass/main.jsbundle, 然后使用命令重新生成文件。
react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/CxyLiveClass/main.jsbundle
问题4 react native command not found 参考链接 cd android./gradlew assembleReleaseAndroid studio工具,选择菜单栏的build选项 Build -> Generate Signed Bundle or APK -> APK -> nextmy-release-key.keystore文件在<project_name>/android/app/目录下password都是123456 (CxyBlock 密码是cxy123456) 程序媛的签名文件是
girls.jks,密码也是123456。遇到打包后的apk图片等资源没有显示的问题,请先打包一下资源文件。
Java.io.IOException:Execution of compression failed., 清除缓存即可./gradlew cleanbuild.gradle minSdkVersion -> 23(正常情况27) v1SigningEnabled true v2SigningEnabled true./gradlew assembleRelease特别注意的一点是,打包出来的音频文件,需要删掉后,再执行打包apk的命令。
方式1:(过去的版本,即项目含有index.android.js文件)
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
方式2:(现在的版本,即项目含有index.js文件)
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.bundle --assets-dest android/app/src/main/res/
主动启动server(清空缓存)
yarn start -- --reset-cacheiOS运行命令
xcode的run (建议用这个)yarn ios 或 yarn react-native run-ios问题1 清空缓存时报错 listen EADDRINUSE: address already in use & Commond failed with exit code 1 把其他的react终端窗口关闭问题2 真机调试报错Unable to prepare Bin的iPad mini for development. Please check the Devices 重启设备解决问题 或 在此链接检查xcode版本支持的最低SDK版本问题3 真机调试build报错Showing Recent Messages Cycle in dependencies between targets 'RNPermissions' and 'React-RCTText';
building could produce unreliable results. 问题4 Xcode发版 Distribute App 提示no app store connect account 解决方法:重启Xcode问题5 不能连接到metro,console.log 不能在终端中打印 解决方法: 确认调试设备和电脑连接在同一WiFi下,或参考此链接问题6 读取本地文件(播放本地视频文件)注意文件名不要用中文!问题7 react-native-fs RNFS.stopDownload(jobId) undefined 参考链接Android
cd ./android 然后./gradlew clean 清空缓存 android studio工具的runyarn react-native run-androidyarn android 橙旭园课堂 安卓调试直接在项目里输入 react-native run-android
问题1 真机调试安装结束后闪退:清除缓存
问题2 使用apk安装结束后闪退:查看搜索是否有自动导入的库,如果有删除并重新打包;或清楚缓存git add <file_name> 或 git add .git commit -m "commit message"git pullgit pushgit clone <git_address>git@git.haorenao.cn:Orange-Block.gitgit@git.haorenao.cn:OpenKidsMath.gitgit@git.haorenao.cn:Orange-Programming.gitgit@git.haorenao.cn:ChengXuYuan-iOS.gitgit@git.haorenao.cn:program_girl-rn-iOS.gitgit@git.haorenao.cn:ChengXuYuan-App-Parent.git'atomic_notify_one<unsigned long>' is unavailable将
use_flipper!改成下面这样,之后重新执行pod install --repo-update
flipperkit_version = '0.102.0'use_flipper!({ 'Flipper' => flipperkit_version, 'Flipper-Folly' => '2.6.7', 'Flipper-RSocket' => '1.4.3', 'Flipper-DoubleConversion' => '3.1.7', 'Flipper-Glog' => '0.3.9', 'Flipper-PeerTalk' => '0.0.4' })
Error:spawnSync ./gradlew EACCESchmod 755 android/gradlew
应用内购
跨平台运行的应用程序可能允许用户在其他平台或您的网站上访问他们在您的应用程序中获得的内容、订阅或功能,包括多平台游戏中的消耗品,前提是这些项目也可以在应用程序内作为应用内购买获得。虚拟货币或商品注意针对app store账号做隐藏
审核未通过,问题询问
在解决方案中心,审核意见的最后可以直接询问回复