Иони c Cordova Run android не работает с Cordova 9.0.0 - PullRequest
0 голосов
/ 07 января 2020

Приведенная ниже ошибка появляется каждый раз, когда я запускаю ionic cordova emulate android или ionic cordova run android

> cordova.cmd build android --device
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\user\AppData\Local\Android\sdk (DEPRECATED)
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :wrapper

BUILD SUCCESSFUL in 32s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
Downloading https://services.gradle.org/distributions/gradle-6.0.1-bin.zip
.........10%.........20%.........30%.........40%.........50%.........60%.........70%.........80%.........90%.........100%
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The onesignal-gradle-plugin MUST be before com.android.application!
   Please put onesignal-gradle-plugin first OR update to com.android.tools.build:gradle:3.0.0 or newer!


Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;

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

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

BUILD FAILED in 7s

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
F:\Ergo-standing-app\standingapp-i4\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;

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

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

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

        cordova.cmd build android --device exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

. Из-за этого я не могу завершить sh мою настройку уведомления о сигнале oneSignal для ioni c.

Детали версии Gradle:

------------------------------------------------------------
Gradle 6.0.1
------------------------------------------------------------

Build time:   2019-11-18 20:25:01 UTC
Revision:     fad121066a68c4701acd362daf4287a7c309a0f5

Kotlin:       1.3.50
Groovy:       2.5.8
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_211 (Oracle Corporation 25.211-b12)
OS:           Windows 10 10.0 amd64

Детали версии Cordova:

9.0.0 (cordova-lib@9.0.1)

Иони c Информация:

Иони c:

   Ionic CLI                     : 5.2.4 (C:\Users\user\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.11.7
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Capacitor:

   Capacitor CLI   : 1.4.0
   @capacitor/core : 1.1.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 9 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.3.0

System:

   NodeJS : v10.16.2 (C:\Program Files\nodejs\node.exe)
   npm    : 6.9.0
   OS     : Windows 10

Когда я использую команду ioni c показания конденсатора android, я могу эмулировать приложение на моем устройстве. Но это не поможет распознать его в качестве подписчика для приложения oneignal.

1 Ответ

0 голосов
/ 15 января 2020

Я столкнулся с той же проблемой. Использование старой версии gradle решило эту проблему для меня. Я использовал https://services.gradle.org/distributions/gradle-4.10.3-bin.zip

Просто проверьте файл build.gradle, чтобы найти правильную версию для вашего проекта.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...