1. 程式人生 > >react-native遇到過的錯誤

react-native遇到過的錯誤

記錄下使用react-native過的錯誤,實習期間一直沒空寫部落格~~~現在把筆記上還記著的一些錯誤發出來

1、development return response error 500:一般是引用檔案元件等的路徑錯誤,找不到;

2、cannot excute importjavascriptexception: 一般是寫錯變數名稱等;

3、匯入圖片資源時,需要重新打包;

4、Application has not been registered the error often happens when you’re running a wrong folder:這個錯誤是執行react-native run-native的目錄和npm start的目錄不一樣導致;

5、**can’t find \node_modules\react-native\local-cli\cli.js:**npm install把缺少的東西安裝上;

6、outDexFolder must be a folder :

不理他;

7、Failed to
create…android/app/build/intermediates/debug/mergin

g:不理他 ;

8、更新state後,使用state的值,提示null:重新重新整理應用;

9、The SDK Build Tools revision (23.0.1) is too low for project ‘:react-native-vector-icons’. Minimum :更改react-native-vector-icons 的android/app/build.gradle 的buildToolsVersion為 “25.0.0” ;

10、error while updating property ‘src’ of a view managed

by:RCTImageView: 一般情況是Image元件的圖片源得不到或者格式有誤;

11、UnableToResolveerror undefined:npm新的包以後,需要重新react-native start;

12、Execution failed for task ‘:app:compileDebugJavaWithJavac’.
> Compilation failed; see the compiler error output for details.:
應該是改了java程式碼沒法編譯,我用AS開啟專案進行安裝又成功了~~~

13、Could not find property’JIMU_RELEASE_STORE_FILE
* on SigningConfig_Decorated{name=release, storeFile=null, storePassword=null, keyAlias=null, keyPassword=null
, storeType=null}.:
        刪除掉android/app/build.gradle 裡的:
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD