Я делаю проект IN FLUTTER, приложение для отображения изменяющейся широты и долготы в реальном времени из базы данных Firebase в карту Google.
ошибка в версии Gradle
вот файл build.gradle
buildscript {
ext.kotlin_version = '2.0.0' // Use the latest stable version of Kotlin
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:8.5.0' // Ensure this version is compatible with your project
classpath 'com.google.gms:google-services:4.4.2' // Ensure this version is compatible with your project
}
}
plugins {
id "com.android.application"
id "kotlin-android"
id 'com.google.gms.google-services' // Firebase Configuration
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.1.0.0')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.1')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
android {
compileSdkVersion 34
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "com.aaddev.my_loc"
minSdkVersion flutter.minSdkVersion // Ensure flutter.minSdkVersion is defined, otherwise use a specific value like 20
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:33.1.1')
implementation 'com.google.firebase:firebase-analytics-ktx'
}
flutter {
source '../..'
}
Я обновил версию Kotlin до 2.0.0, но возникла ошибка
e: C:/Users/user/.gradle/caches/transforms-3/7b98c11195bdca8224a49fc5d6002767/transformed/jetified-kotlin-stdlib-2.0.0.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: C:/Users/user/.gradle/caches/transforms-3/7b98c11195bdca8224a49fc5d6002767/transformed/jetified-kotlin-stdlib-2.0.0.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: C:/Users/user/.gradle/caches/transforms-3/7b98c11195bdca8224a49fc5d6002767/transformed/jetified-kotlin-stdlib-2.0.0.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: C:/Users/user/.gradle/caches/transforms-3/810712b9a5e6b19d9828bd87b672432b/transformed/jetified-firebase-analytics-ktx-22.0.1-api.jar!/META-INF/java.com.google.android.libraries.firebase.firebase_analytics_ktx_granule.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: C:/Users/user/.gradle/caches/transforms-3/bb9f6311be59e44fb99f3c2ff4470e95/transformed/jetified-play-services-measurement-api-22.0.1-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.measurement_api_measurement_api.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* 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 7m 47s
Running Gradle task 'assembleDebug'... 468.6s
┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/releases.ht ... se-details, then update │
│ E:\realtime2\android\build.gradle: │
│ ext.kotlin_version = '' │
└───────────────────────────────────────────────────────────────────────────────────────────────────┘
Gradle task assembleDebug failed with exit code 1 i updated kotilin to latest version that is 2.0.0 but then also same error is rising
Подробнее здесь: https://stackoverflow.com/questions/786 ... ild-gradle
Проблема в версии gradle в build.gradle ⇐ Android
Форум для тех, кто программирует под Android
1719762095
Anonymous
Я делаю проект IN FLUTTER, приложение для отображения изменяющейся широты и долготы в реальном времени из базы данных Firebase в карту Google.
ошибка в версии Gradle
вот файл build.gradle
buildscript {
ext.kotlin_version = '2.0.0' // Use the latest stable version of Kotlin
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:8.5.0' // Ensure this version is compatible with your project
classpath 'com.google.gms:google-services:4.4.2' // Ensure this version is compatible with your project
}
}
plugins {
id "com.android.application"
id "kotlin-android"
id 'com.google.gms.google-services' // Firebase Configuration
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.1.0.0')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.1')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
android {
compileSdkVersion 34
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "com.aaddev.my_loc"
minSdkVersion flutter.minSdkVersion // Ensure flutter.minSdkVersion is defined, otherwise use a specific value like 20
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:33.1.1')
implementation 'com.google.firebase:firebase-analytics-ktx'
}
flutter {
source '../..'
}
Я обновил версию Kotlin до 2.0.0, но возникла ошибка
e: C:/Users/user/.gradle/caches/transforms-3/7b98c11195bdca8224a49fc5d6002767/transformed/jetified-kotlin-stdlib-2.0.0.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: C:/Users/user/.gradle/caches/transforms-3/7b98c11195bdca8224a49fc5d6002767/transformed/jetified-kotlin-stdlib-2.0.0.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: C:/Users/user/.gradle/caches/transforms-3/7b98c11195bdca8224a49fc5d6002767/transformed/jetified-kotlin-stdlib-2.0.0.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: C:/Users/user/.gradle/caches/transforms-3/810712b9a5e6b19d9828bd87b672432b/transformed/jetified-firebase-analytics-ktx-22.0.1-api.jar!/META-INF/java.com.google.android.libraries.firebase.firebase_analytics_ktx_granule.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: C:/Users/user/.gradle/caches/transforms-3/bb9f6311be59e44fb99f3c2ff4470e95/transformed/jetified-play-services-measurement-api-22.0.1-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.measurement_api_measurement_api.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* 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 7m 47s
Running Gradle task 'assembleDebug'... 468.6s
┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then update │
│ E:\realtime2\android\build.gradle: │
│ ext.kotlin_version = '' │
└───────────────────────────────────────────────────────────────────────────────────────────────────┘
Gradle task assembleDebug failed with exit code 1 i updated kotilin to latest version that is 2.0.0 but then also same error is rising
Подробнее здесь: [url]https://stackoverflow.com/questions/78689059/problem-in-version-of-gradle-in-build-gradle[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия