react native筆記-個人記錄-初始化工程遇到的問題

使用Expo工具

在mac上安裝expo,如果是權限問題可以參考以下解決方法
https://blog.csdn.net/testcs_dn/article/details/78869419
https://jingyan.baidu.com/article/9c69d48ff88b3813c9024e9d.html

這是第二條鏈接的說明:對於Mac OS X 10.11 El Capitan用戶,由於系統啓用了SIP(System Integrity Protection), 導致root用戶也 沒有權限修改/usr/bin目錄。按如下方式可恢復權限。
屏蔽方法:重啓Mac,按住command+R,進入recovery模式。選擇打開Utilities下的終端,輸入:csrutil disable並回車,然後正常重啓Mac即可。

報錯: react native fsevents unavailable (this watcher can only be used on Darwin)

解決的辦法參考鏈接
npm r -g watchman
brew install watchman
注意:這裏我使用npm install watchman還是有問題的,但是換成brew安裝後沒有問題

react-native run-ios報錯

Could not find iPhone 6 simulator參考鏈接

Command+shift+.可以顯示/隱藏以"."開頭的文件或者文件夾

解決 React-Native mac 運行報錯 error Failed to build iOS project. We ran “xcodebuild” command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by ope

地址,如果按照以上的還有問題使用sudo跑下https://www.cnblogs.com/stevexu/archive/2019/04/21/10745769.html

如果顯示像下面圖片一樣,但是模擬器沒有安裝程序,可能需要kill一下進程,下面的鏈接很詳細的說明了各種情況

react-native run-ios遇到的問題說明:https://juejin.im/post/5ca2e560e51d456d3550dd5c

在這裏插入圖片描述

解決node.js - Node already installed, it’s just not linked

解決鏈接:http://www.itkeyword.com/doc/7125537006697543345/node-already-installed-its-just-not-linked

解決升級到Xcode10,react native項目運行報錯問題

我遇到的錯誤是下面這個或者沒有config.f的,**

這個鏈接很有用**

錯誤一:Xcode 10: Build input file double-conversion cannot be found
error: Build input file cannot be found: '../node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc'
configure: error: in `../node_modules/react-native/third-party/glog-0.3.4'

解決鏈接:https://blog.csdn.net/chensenp/article/details/83543724

完美解決:"library not found for - "

該文章提供了很多的解決方案:https://blog.csdn.net/liujia216/article/details/53112709
我也遇到了該問題,但是項目的這個庫是別人封裝的,所以我暫時是把該庫移除了

React Native 日常報錯 ‘config.h’ file not found

解決鏈接:https://blog.csdn.net/qq_28978893/article/details/78720488

修改模擬器

react-native run-ios --simulator "iPhone X" //iPhone X是需要使用的模擬器

真機調試鏈接

真機調試查看連接的設備

adb devices

注意:需要確保你的電腦和手機設備在同一個Wi-Fi環境下,要不然我的會出現閃退
真機調試修改和查看

把就項目放到android studio報錯

Error:(24, 0) Could not find method implementation() for arguments [directory ‘libs’] on object of t

這種方式會有警告,告訴你compile過時了,你可以選擇升級gradle,解決鏈接

Android Studio 報錯:Could not find com.android.support:appcompat-v7:28.0.0-beta01.

加上google(),解決鏈接

AManifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).Suggestion: add ‘tools:replace="android:appComponentFactory"’ to element at AndroidManifest.xml:5:5-20:19 to override.

解決鏈接
添加tools

android studio 歷史版本下載地址

歷史版本下載地址

android studio mac完全卸載

https://blog.csdn.net/elonspace/article/details/51800949

gradle各個版本下載

http://services.gradle.org/distributions/

Lint found fatal errors while assembling a release target. 問題的解決方案

https://www.jianshu.com/p/9a3d4dddfcb2

Android Studio編譯報Couldn’t follow symbolic link錯誤

https://www.jianshu.com/p/11a304b670e5

Error: EACCES: permission denied, mkdir 類的問題

https://stackoverflow.com/questions/49679808/error-eacces-permission-denied-mkdir-usr-local-lib-node-modules-node-sass-b

找不到資源,可能需要統一版本依賴

Android resource linking failed
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v26/values-v26.xml:7: error: resource android:attr/colorError not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v26/values-v26.xml:11: error: resource android:attr/colorError not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v26/values-v26.xml:15: error: style attribute ‘android:attr/keyboardNavigationCluster’ not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2637: error: resource android:attr/fontStyle not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2637: error: resource android:attr/font not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2637: error: resource android:attr/fontWeight not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2637: error: resource android:attr/fontVariationSettings not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2637: error: resource android:attr/ttcIndex not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2689: error: resource android:attr/startX not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2689: error: resource android:attr/startY not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2689: error: resource android:attr/endX not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2689: error: resource android:attr/endY not found.
/Users/sunrifa/sendiWork/dr_reborn_app_react/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2690: error: resource android:attr/offset not found.
error: failed linking references.

在這裏插入圖片描述

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.facebook.react:react-native:0.54.2'
    compile 'com.google.android.gms:play-services-gcm:11.0.4'
    compile 'me.leolin:ShortcutBadger:1.1.8@aar'
}

修改上面的三個值,保持依賴版本統一

Cannot add task ‘wrapper’ as a task with that name already exists

https://stackoverflow.com/questions/53709282/cannot-add-task-wrapper-as-a-task-with-that-name-already-exists

react-native-keychain: 錯誤: 找不到符號 符號: 類 StrongBoxUnavailableException

重新裝下 yarn add [email protected],裝後打開報錯的文件,發現代碼少了報錯的代碼,不知是否是之前開發添加的

Invoke-customs are only supported starting with Android O (–min-api 26)

https://www.jianshu.com/p/434928537a90

React Native version mismatch 錯誤

https://blog.csdn.net/awy1988/article/details/80336913

有可能是你在跑兩個react-native不同的版本時也會有這個問題

特批項目

升級gradle爲3.4.1
重新安裝react-native-keychain,解決找不到類的問題
升級video爲4.1.0
修改react-native-device-info的依賴包中的play-services-gcm的版本爲15.0.1

react-native run-ios命令失敗(PCH問題),但是在xcode中構建成功

http://www.voidcn.com/article/p-owrbmtsz-btr.html
把項目根目錄下的ios/build目錄刪除,重新構建

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章