将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文件夹。我已经试过了,没有变化
有人知道这个问题的解决方法吗?我不知道,任何帮助都将不胜感激
从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前缀运行时,效果是一样的