Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Android - Module was compiled with an incompatible version of Kotlin. #144

Open
ngocle2497 opened this issue Jan 14, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@ngocle2497
Copy link

Bug

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Install blurhash
build android

Expected behavior
Build android succeedfully

Screenshots
image

Environment

Additional context
Add any other context or screenshots about the feature request here.

System:
    OS: macOS 11.3
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 146.59 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.0.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.11.2 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    Android SDK:
      API Levels: 28, 29, 30, 31
      Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0
      System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7583922
    Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66.4 => 0.66.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
"react": 17.0.2,
"react-native": 0.66.4,
"react-native-blurhash": 1.1.8
@ngocle2497 ngocle2497 added the bug Something isn't working label Jan 14, 2022
@andresribeiro
Copy link

i'm having the same problem

@Yonom
Copy link

Yonom commented Jan 22, 2022

This also affects us, we downgraded to 1.1.5, which is the highest working version.

Similar issue: expo/expo#15989 (comment)

@ngocle2497
Copy link
Author

I patch-package with RNBlurhash_kotlinVersion=1.6.10 then it working

@JacobJaffe
Copy link

I faced this issue while building this with expo EAS.
The issue I got was:

Execution failed for task ':react-native-blurhash:compileReleaseKotlin'.

I then tried the the patch package solution. That fixed the original issue, but led to the following:

[stderr]       > The minCompileSdk (31) specified in a
[stderr]         dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
[stderr]         is greater than this module's compileSdkVersion (android-30).
[stderr]         Dependency: androidx.lifecycle:lifecycle-runtime-ktx:2.4.0.
[stderr]         AAR metadata file: /home/expo/.gradle/caches/transforms-3/a9daf67f7e6cea363ab3a1ff1cb0d90b/transformed/jetified-lifecycle-runtime-ktx-2.4.0/META-INF/com/android/build/gradle/aar-metadata.properties.

That referenced line was introduced here: e1b3fc6

So I also downgraded to 1.1.5, and then the build succeeded.

@Dag0n
Copy link

Dag0n commented Feb 28, 2022

looks like the npm version is a little beind this.

If you change your package.json from
"react-native-blurhash": "^1.1.8",
to
"react-native-blurhash": "https://github.com/mrousavy/react-native-blurhash/",

it will run as expected.

@JacobJaffe
Copy link

Yeah, it looks like #150 fixes this?

@jonxssc
Copy link

jonxssc commented May 16, 2023

Bug is still there, i have a temporary fix for everyone who faces this error:
go to react-native-blurhash in the node-modules folder. There go to android/build.gradle and search for this line org.jetbrains.kotlin:kotlin-gradle-plugin, change it to: org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20 save, then run cd android && ./gradlew clean and then restart your App, works for me, i hope this bug gets fixed soon

@andybui090
Copy link

andybui090 commented Nov 1, 2023

For me, adding config kotlinVersion in file build.gradle in android folder as below:
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 23
compileSdkVersion = 33
targetSdkVersion = 33
kotlinVersion = "1.7.10" //fix kotlin version RN blurhash
ndkVersion = "23.1.7779620"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants