我已经在react native中开发应用程序大约2年了。之前,运行和更新应用程序没有任何问题。我不知道在开发的什么时候,Metro bundler在运行npx react-native run-android
时开始停止。当我运行此命令时,它会执行所有处理,并启动一个带有Metro bundler的窗口(但在过程中间这个窗口关闭),最后在移动终端上安装并启动应用程序,这是相当不方便的,因为要验证一个小的更改,我必须运行命令npx react-native bundle
*,然后再次运行npx react-native run-android
。这意味着要验证一些更改,我必须等待3或4分钟。
- 捆绑命令:
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
我的开发环境和其他信息:
- 操作系统:Windows 10.
- 代码编辑:Visual Studio代码。
- 项目RN版本:0.67.2.
我尝试了以下方法,但没有找到解决方案:
- 运行
cd android && ./gradlew clean && cd ../
命令。 - 删除node_modules文件夹并运行
npm install
命令。
如果它有助于npx react-native run-android
命令输出:
> AppName@0.0.1 android
> react-native run-android
warn Package @react-native-masked-view/masked-view has been ignored because it contains invalid configuration. Reason: Cannot find module '@react-native-masked-view\masked-view\package.json'
Require stack:
- C:\DATA\Projects\ProjectName\Code\AppName\node_modules\@react-native-community\cli-tools\build\resolveNodeModuleDir.js
- C:\DATA\Projects\ProjectName\Code\AppName\node_modules\@react-native-community\cli-tools\build\releaseChecker\index.js
- C:\DATA\Projects\ProjectName\Code\AppName\node_modules\@react-native-community\cli-tools\build\index.js
- C:\DATA\Projects\ProjectName\Code\AppName\node_modules\@react-native-community\cli\build\tools\config\resolveNodeModuleDir.js
- C:\DATA\Projects\ProjectName\Code\AppName\node_modules\@react-native-community\cli\build\tools\config\resolveReactNativePath.js
- C:\DATA\Projects\ProjectName\Code\AppName\node_modules\@react-native-community\cli\build\tools\config\index.js
- C:\DATA\Projects\ProjectName\Code\AppName\node_modules\@react-native-community\cli\build\commands\install\install.js
- C:\DATA\Projects\ProjectName\Code\AppName\node_modules\@react-native-community\cli\build\commands\index.js
- C:\DATA\Projects\ProjectName\Code\AppName\node_modules\@react-native-community\cli\build\index.js
- C:\DATA\Projects\ProjectName\Code\AppName\node_modules\@react-native-community\cli\build\bin.js
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1282 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
> Task :app:processDebugMainManifest
Execution optimizations have been disabled for task ':app:processDebugMainManifest' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\navigation_json\debug\navigation.json'. Reason: Task ':app:processDebugMainManifest' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:processDebugManifest
Execution optimizations have been disabled for task ':app:processDebugManifest' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\compatible_screen_manifest\debug'. Reason: Task ':app:processDebugManifest' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\merged_manifest\debug\AndroidManifest.xml'. Reason: Task ':app:processDebugManifest' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:compressDebugAssets
Execution optimizations have been disabled for task ':app:compressDebugAssets' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\assets\debug\mergeDebugAssets'. Reason: Task ':app:compressDebugAssets' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:processDebugManifestForPackage
Execution optimizations have been disabled for task ':app:processDebugManifestForPackage' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\merged_manifests\debug'. Reason: Task ':app:processDebugManifestForPackage' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:mergeDebugJavaResource
Execution optimizations have been disabled for task ':app:mergeDebugJavaResource' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\java_res\debug\out'. Reason: Task ':app:mergeDebugJavaResource' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:mergeLibDexDebug
Execution optimizations have been disabled for task ':app:mergeLibDexDebug' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\duplicate_classes_check\debug'. Reason: Task ':app:mergeLibDexDebug' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:mergeExtDexDebug
Execution optimizations have been disabled for task ':app:mergeExtDexDebug' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\duplicate_classes_check\debug'. Reason: Task ':app:mergeExtDexDebug' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\external_file_lib_dex_archives\debug'. Reason: Task ':app:mergeExtDexDebug' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:mergeDebugNativeLibs
Execution optimizations have been disabled for task ':app:mergeDebugNativeLibs' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\merged_jni_libs\debug\out'. Reason: Task ':app:mergeDebugNativeLibs' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:stripDebugDebugSymbols
Execution optimizations have been disabled for task ':app:stripDebugDebugSymbols' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: 'C:\DATA\Projects\ProjectName\Code\AppName\android\app\build\intermediates\merged_native_libs\debug\out'. Reason: Task ':app:stripDebugDebugSymbols' uses this output of task ':app:copyDebugIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:installDebug
Installing APK 'com.appname-2.5-29-debug.apk' on 'SM-A530F - 9' for :app:debug
Installed on 1 device.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
Execution optimizations have been disabled for 9 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
BUILD SUCCESSFUL in 1m 1s
293 actionable tasks: 11 executed, 282 up-to-date
info Connecting to the development server...
info Starting the app on "5200ba9a5e7cc481"...
Starting: Intent { cmp=com.appname/.MainActivity }
1条答案
按热度按时间xlpyo6sf1#
升级到0.71.3后这里也一样,有什么更新吗?