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

Error deploying Ionic app to Android Phone (Ionic 4)

我是 运行 命令 ionic cordova run android,USB 数据线按预期连接。该应用程序构建,然后当它开始构建 apk 以部署到我的 phone 我在终端中遇到此错误。

> 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 工作室根目录中的 .gradle 文件夹项目。我已经试过了,没有任何变化。

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

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

  2. Task.leftShift(Closure) 方法已被弃用,计划在 Gradle 5.0 中删除。请改用 Task.doLast(Action)。------------>无影响。

  3. at build_3e7pv4o3p5wholih0470cvjae.run (/Users/user/Documents/BoutiqueSolicitors/BoutiqueSolicitors/platforms/android/app/build.gradle:148) 项目“:app”中的配置 'compile' 已弃用。请改用 'implementation'。 ---------->修改 app/build.gradle 中的依赖项以使用 'implemntation' 而不是 'compile'.

  4. :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl FAILED.------------>看看你的aidl 相关更改;比如aidl接口的定义和位置。

运行 来自 android 工作室终端的命令 'gradlew assembleDebug --debug' 并查看它是否提供有关构建失败的更多详细信息。