#react-native BUG#
生活随笔
收集整理的這篇文章主要介紹了
#react-native BUG#
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
這篇文章主要解決react-native中遇到的bug。
環境:window10
Error: Command failed: gradlew.bat installDebug
編譯并運行 React Native 應用之前我們可以使用下面的方法清理gradlew 和之前的構建文件。
Error: Command failed: gradlew.bat installDebug Failed to capture snapshot of output files for task':app:transformClassesWithDexBuilderForDebug' property 'streamOutputFolder' during up-to-date check. Could not read path 'project\android\app\build\intermediates\transforms\dexBuilder\debug\49\android\arch\lifecycle'.解決方案:
在項目目錄下輸入下面的命令:react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
The module ../lib/props could not be found from `projectnode_modulesreact-native-svgelementsRect.js
這個是緩存問題
bundling failed: Error: Unable to resolve module `../lib/props` from `project\node_modules\react-native-svg\elements\Rect.js`: The module `../lib/props` could not be found from `project\node_modules\react-native-svg\elements\Rect.js`.解決方案
執行下面的命令npm install
執行下面的命令npm start -- --reset-cache
emulator: ERROR: x86 emulation currently requires hardware acceleration!
場景描述:在react-native 開發的時候,點擊AVDManager按鈕,出現的報錯信息。
解決方法(參考)
進入SDK目錄
目錄結構大致這樣: C:users%USERNAME%AppDataLocalAndroidsdkextrasintelHardware_Accelerated_Execution_Manager
執行安裝這個文件: intelhaxm-android.exe。
執行的過程中可能會報錯這樣的信息:‘Intel virtualization technology (vt,vt-x) is not enabled’。
這個問題的解決方法是(參考):
undefined is not an object (evaluating 'RNGestureHandlerModule.State')
yarn add react-native-gesture-handler react-native link react-native-gesture-handlersettings file 'projectandroidsettings.gradle': 3: unexpected char: '\' @ line 3, column 133
new File(rootProject.projectDir, '..\node_modules\react-native-gesture-handler\android') //替換成下面的這個,即在加一個‘\’ new File(rootProject.projectDir, '..\\node_modules\\react-native-gesture-handler\\android')總結
以上是生活随笔為你收集整理的#react-native BUG#的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Vue CLI3.0 中使用jQuery
- 下一篇: git分散式版本管理系统,从安装到基本使