将Ionic应用程序部署到Android Phone(Ionic 4)时出错

将Ionic应用程序部署到Android Phone(Ionic 4)时出错

问题描述:

我正在运行命令 ionic cordova run android ,并按预期连接了USB电缆.该应用程序会构建,然后在开始构建将apk部署到我的手机上时,我在终端中遇到此错误.

I am running the command ionic cordova run android with the usb cable connected as expected. The app builds, and then when it starts to build the apk to deploy on to my phone I'm hit with this error in the terminal.

> cordova run android Android Studio project detected ANDROID_HOME=/Users/user/Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home studio Subproject Path: CordovaLib Subproject Path: app publishNonDefault is deprecated and has no effect anymore. All variants are now published. The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_3e7pv4o3p5wholih0470cvjae.run(/Users/user/Documents/BoutiqueSolicitors/BoutiqueSolicitors/platforms/android/app/build.gradle:148) Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl FAILED

FAILURE: Build failed with an exception.

* What went wrong: null value in entry: incrementalFolder=null

* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s 1 actionable task: 1 executed /Users/user/Documents/BoutiqueSolicitors/BoutiqueSolicitors/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

* What went wrong: null value in entry: incrementalFolder=null

* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s [ERROR] An error occurred while running subprocess cordova.

        cordova run android exited with exit code 1.

我查找了错误:incrementalFolder = null,发现有人说要修复此错误,您需要删除现有android studio项目根目录下的.gradle文件夹.我没有做任何尝试.

I looked up the error: incrementalFolder=null, and I found that people were saying to fix this error you need to delete .gradle folder inside the root directory of an existing android studio project. I have tried this with no change.

有人知道这个解决方法吗?我一无所知,任何帮助将不胜感激.

Does anyone know a fix for this? I am clueless, any help would be greatly appreciated.

  1. 子项目路径:CordovaLib子项目路径:app publishNonDefault已弃用,不再起作用.所有变体现已发布.----------->没有影响.

  1. Subproject Path: CordovaLib Subproject Path: app publishNonDefault is deprecated and has no effect anymore. All variants are now published.-----------> No impact.

不推荐使用Task.leftShift(Closure)方法,并计划在Gradle 5.0中将其删除.请改用Task.doLast(Action).----------->没有影响.

The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.----------->No impact.

(/Users/user/Documents/BoutiqueSolicitors/BoutiqueSolicitors/platforms/android/app/build.gradle:148)不建议在项目':app'中使用配置'compile'.请改用实现".---------->修改app/build.gradle中的依赖项以使用实现"而不是编译".

at build_3e7pv4o3p5wholih0470cvjae.run (/Users/user/Documents/BoutiqueSolicitors/BoutiqueSolicitors/platforms/android/app/build.gradle:148) Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. ---------->Modify dependencies in app/build.gradle to use 'implemntation' instead of 'compile'.

:CordovaLib:preBuild UP-TO-DATE:CordovaLib:preDebugBuild UP-TO-DATE:CordovaLib:compileDebugAidl FAILED.像辅助界面的定义和位置.

:CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl FAILED.------------>look into your aidl related changes; like definition and location of aidl interface.

从android studio终端运行命令'gradlew assembleDebug --debug',看看它是否提供有关构建失败的更多详细信息.

run command 'gradlew assembleDebug --debug' from android studio terminal and see if it gives more details on build failure.