我尝试在创建新应用后运行我的本机应用v0.53并收到错误
Total time: 21.148 secs
Could not build the app, read the error above for details.
Running C:\Users\XXXX\AppData\Local\Android\sdk/platform-tools/adb -s 29d84044 reverse tcp:8081 tcp:8081
Installing the app on the device (cd android && adb -s 29d84044 install app/build/outputs/apk/app-debug.apk
adb: failed to stat app/build/outputs/apk/app-debug.apk: No such file or directory
Command failed: C:\Users\XXXX\AppData\Local\Android\sdk/platform-tools/adb -s 29d84044 install app/build/outputs/apk/app-debug.apk
Could not install the app on the device, read the error above for details.
Starting the app on 29d84044 (C:\Users\XXXX\AppData\Local\Android\sdk/platform-tools/adb -s 29d84044 shell am start -n com.sleepcalculator/com.sleepcalculator.MainActivity)...
Starting: Intent { cmp=com.sleepcalculator/.MainActivity }
Error type 3
Error: Activity class {com.sleepcalculator/com.sleepcalculator.MainActivity} does not exist.
错误
What went wrong:
Execution failed for task ':app:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
我已经尝试过做的事情: 删除npm缓存,npm安装,删除android缓存
答案 0 :(得分:1)
您可能已经安装了具有相同程序包名称的应用程序,因此请确保先从手机/模拟器中删除它。完成后,尝试再次运行该应用程序。
如果没有帮助检查此帖子: https://github.com/facebook/react-native/issues/14952