我的应用程序运行完美,然后我尝试通过运行
npx expo run:android --variant release
来编译它以进行生产,但返回错误。
现在,当我运行 npm run android
时,我收到此错误:
...................
C:/Users/Mobile Apps/React Native/AwesomeProject/node_modules/expo-modules-core/android/.cxx/Debug/1g6k43ua/x86_64/CMakeFiles/expo-modules-core.dir/./
has 196 characters. The maximum full path to an object file is 250
characters (see CMAKE_OBJECT_PATH_MAX). Object file
C_/Users/Mobile_Apps/React_Native/AwesomeProject/node_modules/expo-modules-core/common/cpp/ObjectDeallocator.cpp.o
cannot be safely placed under this directory. The build may not work
correctly.
ninja: error: manifest 'build.ninja' still dirty after 100 tries
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 1m 23s
384 actionable tasks: 19 executed, 365 up-to-date
Error: C:\Users\Mobile Apps\React Native\AwesomeProject\android\gradlew.bat app:assembleDebug -x lint -x test --configure-on-demand --build-cache
-PreactNativeDevServerPort=8081 -PreactNativeArchitectures=x86_64 exited with non-zero code: 1
这是我的
package.json
:
我尝试
cd android
然后运行 --stacktrace
和 --scan
以获得更多见解,它为我提供了有关已弃用的软件包的信息。我删除了它们,现在我得到以下结果:
尝试将您的应用程序移动到不同的文件夹中
例如
来自
C:\Users\Mobile Apps\React Native\AwesomeProject ndroid\
移动到
C:\ReactNative\Android
这可能是 Windows 问题,并且在类似情况下移动到较短的目录会有所帮助
https://github.com/mrousavy/react-native-vision-camera/issues/1941