Ionic: compileSdkVersion не указан - не удалось найти метод leftShift () - PullRequest
0 голосов
/ 04 марта 2019

Я только что запустил свое приложение с Ionic 4. На данный момент я никогда не вносил никаких изменений в исходный код, который вы имеете (с дополнительным меню) при запуске проекта.После многих других ошибок у меня есть такая, которую я не знаю, как это исправить.Это происходит, когда я пытаюсь:

Ионный Cordova build android

    FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file 'D:\workspace\iganalytics\app\platforms\android\app\build.gradle' line: 148

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method leftShift() for arguments [build_8ka4my3njl1nfn72j8pdlyfze$_run_closure6@5b9f348] on task ':app:cdvPrintProps' of type org.gradle.api.DefaultTask.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':app'.
> compileSdkVersion is not specified.

* 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 1s
cmd: Command failed with exit code 1 Error output:
FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file 'D:\workspace\iganalytics\app\platforms\android\app\build.gradle' line: 148

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method leftShift() for arguments [build_8ka4my3njl1nfn72j8pdlyfze$_run_closure6@5b9f348] on task ':app:cdvPrintProps' of type org.gradle.api.DefaultTask.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':app'.
> compileSdkVersion is not specified.

* 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 1s
[ERROR] An error occurred while running subprocess cordova.

        cordova build android exited with exit code 1.

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

Я добавил эту строку в config.xml:

<preference name="android-targetSdkVersion" value="28" />

Без удачи.

build.gradle строка 148 начинается с:

task cdvPrintProps << {
    println('cdvCompileSdkVersion=' + cdvCompileSdkVersion)
    println('cdvBuildToolsVersion=' + cdvBuildToolsVersion)
    println('cdvVersionCode=' + cdvVersionCode)
    println('cdvVersionCodeForceAbiDigit=' + cdvVersionCodeForceAbiDigit)
    println('cdvMinSdkVersion=' + cdvMinSdkVersion)
    println('cdvBuildMultipleApks=' + cdvBuildMultipleApks)
    println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile)
    println('cdvDebugSigningPropertiesFile=' + cdvDebugSigningPropertiesFile)
    println('cdvBuildArch=' + cdvBuildArch)
    println('computedVersionCode=' + android.defaultConfig.versionCode)
    android.productFlavors.each { flavor ->
        println('computed' + flavor.name.capitalize() + 'VersionCode=' + flavor.versionCode)
    }
}

Ответы [ 3 ]

0 голосов
/ 17 мая 2019

У меня вчера была похожая проблема, и она была исправлена ​​добавлением <preference name="android-targetSdkVersion" value="22" /> в config.xml

0 голосов
/ 09 июня 2019

Я столкнулся с той же проблемой.Решение было обновление до Android @ 8.Спасибо @Splinteer.Вот еще несколько подробностей о том, как это сделать:

перечислить свои платформы с помощью:

ionic cordova platform list

удалить android с помощью:

ionic cordova platform rm android

добавить android @ 8:

ionic cordova platform add android@8
0 голосов
/ 05 марта 2019

удалось заставить его работать, добавив платформу Android @ 8 вместо только Android, который устанавливает версию 7

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