shyandsy / cipher2

a flutter plugin for AES encryption and decryption
GNU General Public License v3.0
43 stars 40 forks source link

The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher. #3

Open aztrock opened 5 years ago

aztrock commented 5 years ago
FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
The following dependencies do not satisfy the required version:
project ':cipher2' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71

* 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
[✓] Flutter (Channel beta, v1.1.8, on Linux, locale es_CO.utf8)
    • Flutter version 1.1.8 at /home/aztrock/Descargas/android-studio/flutter
    • Framework revision 985ccb6d14 (hace 3 semanas), 2019-01-08 13:45:55 -0800
    • Engine revision 7112b72cc2
    • Dart version 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /home/aztrock/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /home/aztrock/Descargas/android-studio/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.3)
    • Android Studio at /home/aztrock/Descargas/android-studio/android-studio
    • Flutter plugin version 32.0.1
    • Dart plugin version 182.5124
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] Connected device (1 available)
    • ASUS Z00TD • G1AZCY11N547 • android-arm64 • Android 5.0.2 (API 21)

• No issues found!
Process finished with exit code 0
shyandsy commented 5 years ago

could u try to modify the line in cipher2\android\build.gradle?

ext.kotlin_version = '1.3.0'     // to 1.3

or try to use vscode

shyandsy commented 5 years ago

@aztrock any feedback?

shyandsy commented 5 years ago

@aztrock any feedback?

tom161566038 commented 5 years ago

@shyandsy same mistake,tried 1.3.0,still same error, it seems cipher2 in flutter still use 1.2.71 kotlin

tom161566038 commented 5 years ago
shyandsy commented 5 years ago

The flutter plugin is using the Kotlin 1.2.71 as default.

I found these solution on stackoverflow

  1. https://stackoverflow.com/questions/54693595/flutter-the-android-gradle-plugin-supports-only-kotlin-gradle-plugin-version-1

    The problem is you are using version 3.3.1 of the Android Gradle plugin, which enforces Kotlin 1.3.0 or above. At the same time, the geolocator package depends on google_api_availability, which seems to be using Kotlin 1.2.71. At the moment there is no version of google_api_availability that uses Kotlin 1.3.0 or above, so you only have 1 solution - downgrade the Android Gradle plugin to version 3.2.1.

tom161566038 commented 5 years ago

@shyandsy thanku very much for ur kind help,i 'll try it later~

warningwhoami commented 5 years ago

作者你好, 我也碰到这个问题了.

  1. 这个项目单独编译是完全没问题的.

2: ext.kotlin_version = '1.3.21' 这个貌似只对自己的项目有效,对引入的扩展没有作用

3: 经过测试, 进行降级 classpath 'com.android.tools.build:gradle:3.3.1' -> classpath 'com.android.tools.build:gradle:3.2.1'

可以解决这个问题,但是,因为我的项目依赖 com.google.firebase:firebase-core:16.0.8 会引入更大问题:所有androidx全部冲突.

androidx 又是另外一个依赖必备的. 所以只能暂时观望了

warningwhoami commented 5 years ago

不甘心自己动手了下. Fork了项目. 改了这2个地方.

ext.kotlin_version = '1.3.21' classpath 'com.android.tools.build:gradle:3.3.1'

然后依赖改成新的git地址. 完美解决.