Posts

Showing posts with the label kotlin

Upgrading Android kotlin version to 1.5.0 throwing error message on build

6 1 Running with kotlin version '1.4.32' my Android project runs and builds. Trying to upgrade to kotlin '1.5.0' and my build throws: Execution failed for task ':app:kaptDefaultsDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction > java.lang.reflect.InvocationTargetException (no error message) I am not even sure where to start looking. Anyone else have problems upgrading to kotlin 1.5.0? android kotlin Share ...

Android Studio 4.2 Kotlin Plugin Issue

21 2 Cannot build a new project using Android Studio 4.2 because of the following error: A problem occurred configuring root project 'My Application'. > Could not resolve all artifacts for configuration ':classpath'. > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764. Searched in the following locations: - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom Required by: project : Possible solution: - Declare repository providing the artifact, see the docum...

What's an inline constructor in Kotlin?

7 3 First of all I have to clarify I'm not asking what's an inline function is or what's an inline class is. There's nowhere in Kotlin Language documentation or specification any reference to an inline constructor but if you look in Arrays.kt source you see this class: ByteArray has an inline constructor: /** * An array of bytes. When targeting the JVM, instances of this class are represented as `byte[]`. * @constructor Creates a new array of the specified [size], with all elements initialized to zero. */ public class ByteArray(size: Int) { /** * Creates a new array of the specified [size], where each element is calculated by calling the specified * [init] function. * * The function [init] is called for each array element se...

Can't create new Kotlin project after updating to Android Studio 4.2

6 I updated Android studio 4.2 but I wasn't able to create new project kotlin A problem occurred configuring root project 'My Application'. > Could not resolve all artifacts for configuration ':classpath'. > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764. Searched in the following locations: - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release- 764/kotlin-gradle-plugin-1.5.0-release-764.pom - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom Required by: project : Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gr...

Flutter: Create a flutter project with Kotlin

Flutter allows to support of Kotlin language. How can I integrate my kotlin file with Flutter project. There is no option to add/create a Kotlin file (in New menu) in Android Studio. I think the kotlin files can only be used in the platform-specific plugins. E.g. you have platform-specific implementation for both iOS and android and you can use kotlin for the Android part. The Flutter SDK is used directly with Dart. Open your Android module in android so you can add your kotlin files

Error in Kotlin but using only Java - Class kotlin.reflect.jvm.internal.FunctionCaller$FieldSetter

I get this error when try to run my Android application and I am not using Kotlin at all, application is written in Java... Class kotlin.reflect.jvm.internal.FunctionCaller$FieldSetter can not access a member of class com.android.build.gradle.tasks.ManifestProcessorTask with modifiers "private" I solved this way. 1. Delete all the .gradle folders 2. Invalidate caches / restart everything is OK for me. Settings -> Languages & Frameworks -> Kotlin Updates -> Update channel -> Early Access Preview/Stable -> Update -> Restart Or: Tools -> Kotlin -> Configure Kotlin Plugin Update -> Update channel -> Early Access Preview/Stable -> Update -> Restart Delete and rebuild is working for me as well Install the latest Gradle version (1.10.2 at the moment of writing). Install the latest version of Kotlin plugin: go to Settings [Ctrl]+[Alt]+[S] > Languages & Frameworks > Kotlin Updates > select Update channel > cli...