Skip to content

bug:  #76

@eugenedw

Description

@eugenedw

Plugin version:

4.0.1

Platform(s):

Android

Current behavior:

Cannot run application due to Kotlin errors

Execution failed for task ':capacitor-community-photoviewer:kaptGenerateStubsDebugKotlin'.
> Error while evaluating property 'compilerOptions.jvmTarget' of task ':capacitor-community-photoviewer:kaptGenerateStubsDebugKotlin'.
   > Failed to calculate the value of property 'jvmTarget'.
      > Unknown Kotlin JVM target: 21

Expected behavior:

The expectation is that, after applying all the documented configuration settings, that the mobile application will run on a mobile device or emulator. Because of the compilation failures with Kotlin, it doesn't.

Steps to reproduce:

  1. Download the latest version of the plugin.
  2. Configure the plugin for Android using the settings defined in the README.md.
  3. Run the command to launch Android Studio
ionic capacitor build android
  1. From Android Studio, run the app

Related code:

build.gradle (Module :capacitor-community-photoviewer)

buildscript {
    ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.9.10'
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.7.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

...

android {
   ...
   compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    buildFeatures {
        dataBinding true
    }
}

Other information:

Capacitor doctor:

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 6.2.0
  @capacitor/core: 6.2.0
  @capacitor/android: 6.2.0
  @capacitor/ios: 6.2.0

Installed Dependencies:

  @capacitor/cli: 5.7.2
  @capacitor/core: 5.7.2
  @capacitor/android: 5.7.2
  @capacitor/ios: 5.7.2

[success] iOS looking great! 👌
[success] Android looking great! 👌

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions