kotlin - Flutter project will run on Chrome, but not on an emulator, error says, "Could not resolve all files for confi

I can run my program on Chrome with no issues, but I need it to run on an emulator. When I try to run o

I can run my program on Chrome with no issues, but I need it to run on an emulator. When I try to run on an emulator, I receive this error:

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode... Running Gradle task 'assembleDebug'... warning: [options] source value 8 is obsolete and will be removed in a future release warning: [options] target value 8 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. 3 warnings

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':alarm:compileDebugKotlin'.

Could not resolve all files for configuration ':alarm:kotlinCompilerPluginClasspathDebug'. Could not find .jetbrains.kotlin:kotlin-serialization-compiler-plugin-embeddable:1.8.22. Searched in the following locations: - .8.22/kotlin-serialization-compiler-plugin-embeddable-1.8.22.pom - .8.22/kotlin-serialization-compiler-plugin-embeddable-1.8.22.pom - .flutter.io//jetbrains/kotlin/kotlin-serialization-compiler-plugin-embeddable/1.8.22/kotlin-serialization-compiler-plugin-embeddable-1.8.22.pom Required by: project :alarm

I've been googling and trying to find solutions and I am not sure what I can do at this point.

I've heard people say that I should update the Kotlin version, but I can't even figure out where I would do that or if my project is even using Kotlin.

I can run my program on Chrome with no issues, but I need it to run on an emulator. When I try to run on an emulator, I receive this error:

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode... Running Gradle task 'assembleDebug'... warning: [options] source value 8 is obsolete and will be removed in a future release warning: [options] target value 8 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. 3 warnings

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':alarm:compileDebugKotlin'.

Could not resolve all files for configuration ':alarm:kotlinCompilerPluginClasspathDebug'. Could not find .jetbrains.kotlin:kotlin-serialization-compiler-plugin-embeddable:1.8.22. Searched in the following locations: - https://dl.google/dl/android/maven2//jetbrains/kotlin/kotlin-serialization-compiler-plugin-embeddable/1.8.22/kotlin-serialization-compiler-plugin-embeddable-1.8.22.pom - https://repo.maven.apache./maven2//jetbrains/kotlin/kotlin-serialization-compiler-plugin-embeddable/1.8.22/kotlin-serialization-compiler-plugin-embeddable-1.8.22.pom - https://storage.googleapis/download.flutter.io//jetbrains/kotlin/kotlin-serialization-compiler-plugin-embeddable/1.8.22/kotlin-serialization-compiler-plugin-embeddable-1.8.22.pom Required by: project :alarm

I've been googling and trying to find solutions and I am not sure what I can do at this point.

I've heard people say that I should update the Kotlin version, but I can't even figure out where I would do that or if my project is even using Kotlin.

Share Improve this question asked Mar 25 at 20:04 Andrea RoskoskiAndrea Roskoski 1
Add a comment  | 

1 Answer 1

Reset to default 0

Your project has a dependency that uses Kotlin (alarm package). You can try below steps:

1. Update the Kotlin Version

Open android/build.gradle and update:

ext.kotlin_version = '1.8.22'  // Change this to: 
ext.kotlin_version = '1.9.22'

2. Update the Gradle Distribution

Open android/gradle/wrapper/gradle-wrapper.properties and change:

distributionUrl=https\://services.gradle./distributions/gradle-8.2-bin.zip 

3. Update the Gradle Plugin Version

Open android/build.gradle and update:

classpath 'com.android.tools.build:gradle:8.1.0'

4. Sync and Clean the Project

Run the following commands in the terminal:

cd android 
./gradlew clean 
cd .. 
flutter clean 
flutter pub get

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744171451a4561555.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信