Build target Android is broken when using kproject
- Dominant language
- Kotlin
- Stars
- 3k
- Forks
- 148
- Avg merge
- 13h 44m
- Merged PRs (30d)
- 1
Description
## How to reproduce:
* Check out the latest [korge-hello-world](https://github.com/korlibs/korge-hello-world) template
* Update gradle/libs.versions.toml to `version = "3.4.0"`.
* Add `targetAndroidDirect()` to the `build.gradle.kts`
* Run Gradle Task `runAndroidDeviceRelease`
## Error
The Build fails
```kotlin
> Configure project :
Failed to get the version of the applied Android Gradle Plugin
```
```kotlin
Could not create an instance of type org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget.
> Could not generate a decorated class for type KotlinAndroidTarget.
> com/android/build/gradle/api/BaseVariant
```
```kotlin
Unable to load class 'com.android.build.gradle.api.BaseVariant'.
This is an unexpected error. Please file a bug containing the idea.log file.
```
## System
Windows 10 x64
`ANDROID_SDK` points to installed `android-sdk` with platforms `android-28` up to `android-31`
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure in the korge-hello-world template using gradle/libs.versions.toml at version 3.4.0, build.gradle.kts with targetAndroidDirect(), and the runAndroidDeviceRelease task. Start by checking the Android Gradle Plugin and Kotlin Android target setup; done means the task completes without the BaseVariant or KotlinAndroidTarget errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100