authpass / biometric_storage

Flutter plugin to store data behind biometric authentication (ie. fingerprint)
https://pub.dev/packages/biometric_storage
MIT License
184 stars 107 forks source link

Failed to build android on 4.0.1 #55

Closed itaishalom closed 2 years ago

itaishalom commented 2 years ago

Screenshot_20220123-195527

So you know what this is?

hpoul commented 2 years ago

Seems related to #54 - Maybe you can try upgrading Kotlin to 1.6 (or downgrading to the previous plugin version) and see if this resolves the problem for you?

itaishalom commented 2 years ago

Thanks for reply, I'll check

itaishalom commented 2 years ago

Still getting it: Execution failed for task ':biometric_storage:kaptGenerateStubsReleaseKotlin'.

Could not resolve all files for configuration ':biometric_storage:releaseCompileClasspath'. Failed to transform moshi-1.13.0.jar (com.squareup.moshi:moshi:1.13.0) to match attributes artifactType=android-classes-jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.environment=standard-jvm, org.gradle.jvm.version=8, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api, org.jetbrains.kotlin.platform.type=jvm. Execution failed for JetifyTransform: /Users/appdev/.gradle/caches/modules-2/files-2.1/com.squareup.moshi/moshi/1.13.0/da685586facab9eb5c4fb630ce248be14e7da21b/moshi-1.13.0.jar. Failed to transform '/Users/appdev/.gradle/caches/modules-2/files-2.1/com.squareup.moshi/moshi/1.13.0/da685586facab9eb5c4fb630ce248be14e7da21b/moshi-1.13.0.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 60. (Run with --stacktrace for more details.) Suggestions:

i have: distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip and

dependencies { classpath 'com.android.tools.build:gradle:4.1.3' classpath 'com.google.gms:google-services:4.3.4' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"

and

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10"

apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply plugin: 'com.google.firebase.crashlytics'

Have I forgot something?

hpoul commented 2 years ago

I think you are using an old jdk, can you try with java>=16?

itaishalom commented 2 years ago

Where can I set it? (Long time on flutter, forgot android :/)

On Sun, Jan 23, 2022, 22:50 Herbert Poul @.***> wrote:

I think you are using an old jdk, can you try with hands>=16?

โ€” Reply to this email directly, view it on GitHub https://github.com/authpass/biometric_storage/issues/55#issuecomment-1019564402, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFFNCLS2Y3SJLMUZC2LA2LUXRSX5ANCNFSM5MTT2YUQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

hpoul commented 2 years ago

depends how you are building it.. it looks like a CI .. so you have to make sure that your base image as some current java version running.. if you are building on android studio you can choose so in the gradle build configuration.. https://stackoverflow.com/a/64220088/109219

itaishalom commented 2 years ago

You are correct! I'll check it

itaishalom commented 2 years ago

I tried with jdk 17 but the issue remains

hpoul commented 2 years ago

are you sure you are using the right jdk? and it's the same error message? In your previous log it states "Unsupported class file major version 60." which imho can't happen with jdk 17 ๐Ÿคจ

martingeorgiu commented 2 years ago

Hi, the bump-up of the java to 16+ worked, however then there was another issue which was throwing this biometric storage library, caused by kotlin internal "something" (I'm not android dev:D) which was then resolved increasing the kotlin version to 1.6.10.

Also, @itaishalom beware that using Gradle 7.0 you cannot use Java 17 (https://docs.gradle.org/current/userguide/compatibility.html). ๐Ÿ™‚

Ahmadre commented 2 years ago

Same issue, but we cannot upgrade jdk due to other dependencies. Can't we check for actual kotlin version in build.gradle? If-statements exists in Android configs and we wouldn't have these errors for apps that cannot upgrade. This should have been checked in https://github.com/authpass/biometric_storage/pull/54 before merging.

hpoul commented 2 years ago

@Ahmadre feel free to use the old plugin version, or create a PR

tahitiangabriel commented 2 years ago

I've used this workaround : https://github.com/authpass/biometric_storage/issues/53#issuecomment-1027721157

YazeedAlKhalaf commented 2 years ago

i have some input regarding the #54 upgrade. i upgraded my project to the latest stable flutter as of today 2.10.2. now the default Koltin version that flutter projects use for android is 1.6.10.

i also downgraded to 4.0.0 from 4.0.1

biometric_storage still says 1.5.21 here: https://github.com/authpass/biometric_storage/blob/master/android/build.gradle#L5

maybe this is the problem

--

so as a temporary workaround downgrade the kotlin version until we reach to a solution in the plugin code.

hpoul commented 2 years ago

Please see #58 should be fixed in 4.1.0