Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将Ionic应用程序部署到Android手机时出错(Ionic 4)_Android_Cordova_Ionic Framework_Gradle_Android Gradle Plugin - Fatal编程技术网

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

将Ionic应用程序部署到Android手机时出错(Ionic 4),android,cordova,ionic-framework,gradle,android-gradle-plugin,Android,Cordova,Ionic Framework,Gradle,Android Gradle Plugin,我正在运行命令ionic cordova run android,并按预期连接usb电缆。应用程序构建,然后当它开始构建要部署到我手机上的apk时,我在终端中遇到了这个错误 > cordova run android Android Studio project detected ANDROID_HOME=/Users/user/Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/

我正在运行命令
ionic cordova run android
,并按预期连接usb电缆。应用程序构建,然后当它开始构建要部署到我手机上的apk时,我在终端中遇到了这个错误

> 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文件夹。我已经试过了,没有变化

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

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

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

  • 在build3e7pv4o3p5wholih0470cvjae.run(/Users/user/Documents/finitelaughters/finitelaughters/platforms/android/app/build.gradle:148)项目中的配置“compile”:app不推荐使用。使用“实现”代替。------------>修改app/build.gradle中的依赖项以使用“implementation”而不是“compile”

  • :CordovaLib:preBuild-UP-TO-DATE:CordovaLib:preDebugBuild-TO-DATE:CordovaLib:compiledbugaidl失败。-------------->查看与aidl相关的更改;类似于aidl接口的定义和位置


  • 从android studio终端运行命令“gradlew assembleDebug--debug”,看看它是否给出了构建失败的更多细节


    从android studio终端运行命令“gradlew assembleDebug--debug”,查看它是否提供有关构建失败的更多详细信息。在my build.grade中的dependencies下,没有编译,我只有一行:
    classpath'com.android.tools.build:gradle:3.0.1'
    在android studio终端中运行该命令会给我gradlew:command not found errorCorrection-检查了我的ionic项目的build.grade,而不是在android studio中,我现有的两个随机android studio项目build.gradle都是“实现”而不是“编译”的。我应该能够从android studio terminal.bash:gradlew:command not found运行这个命令[gradlew assembleDebug--debug]。当我使用sudo前缀运行时,效果是一样的