react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

🐛 Task :react-native-vision-camera:compileDebugKotlin FAILED

Open bekatd opened this issue 2 years ago • 33 comments

What were you trying to do?

I am trying to install this library

Reproduceable Code

No response

What happened instead?

Build fails at this step: > Task :react-native-vision-camera:compileDebugKotlin FAILED

Relevant log output

> Task :react-native-vision-camera:compileDebugKotlin FAILED
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    user/.gradle/caches/transforms-2/files-2.1/664f78d5defbcdceed6cc6b91334957c/jetified-kotlin-stdlib-jdk8-1.5.30.jar (version 1.5)
    user/.gradle/caches/transforms-2/files-2.1/98f292b47b7ae2a67fdb09d889c153dc/jetified-kotlin-stdlib-jdk7-1.5.30.jar (version 1.5)
    user/.gradle/caches/transforms-2/files-2.1/2482ed84b3d2e1c78620a60749fa204b/jetified-kotlin-stdlib-1.6.10.jar (version 1.6)     
    user/.gradle/caches/transforms-2/files-2.1/a1dc49042920562f5109600bb5b5b2b0/jetified-kotlin-stdlib-common-1.6.10.jar (version 1.6)     
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings
581 actionable tasks: 8 executed, 573 up-to-date
e: \node_modules\react-native-vision-camera\android\src\main\java\com\mrousavy\camera\frameprocessor\FrameProcessorRuntimeManager.kt: (65, 76): Unresolved reference: resolveView

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-vision-camera:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 47s

Device

Xiaomi mi A2 lite (real device)

VisionCamera Version

2.13.2

Additional information

bekatd avatar Apr 22 '22 13:04 bekatd

I tried everything from A to Z found on internet (searching for almost 30 hours). Hope there is some solution :|

bekatd avatar Apr 22 '22 14:04 bekatd

Hi, you didn't post an error message. Only warnings from the log are here (w:). Please post full output.

mrousavy avatar Apr 22 '22 14:04 mrousavy

image

how is this only warning

bekatd avatar Apr 22 '22 14:04 bekatd

Please tell me, what type of log can I give you additionally?

bekatd avatar Apr 22 '22 14:04 bekatd

Downgrading to 2.13.0 fixed it for me. I don't know why.

If it is related to the RN version, I think it should be mentioned in the docs

I am using RN 0.64.1

bekatd avatar Apr 22 '22 14:04 bekatd

Ah my bad I just didn't see the error correctly. You're right, this is available only on newer RN versions

mrousavy avatar Apr 22 '22 15:04 mrousavy

I have this problem too, do we have any updates?

RafaelPena31 avatar Apr 22 '22 18:04 RafaelPena31

See my comment above about downgrade

bekatd avatar Apr 22 '22 19:04 bekatd

This might be related to #957.

vgorte avatar Apr 24 '22 21:04 vgorte

The downgrade did not work here.

"react-native": "0.63.2" "react-native-vision-camera": "2.13.0"

raulburigo avatar Apr 27 '22 15:04 raulburigo

The downgrade did not work here.

"react-native": "0.63.2" "react-native-vision-camera": "2.13.0"

Same here.. Downgrade is also not working for me. I had installed version "2.11.2" After changing and tried with version "2.13.2", "2.13.1" & "2.13.2" facing above error.

And even after changed to old version i.e. "2.11.2", node_modules packages are updated so that error show continue while building Android code.

dhavallogistic avatar May 03 '22 06:05 dhavallogistic

Try to run gradlew clean and delete node modules. Also if you have old expo unimodules installation, try to migrate to new expo modules

bekatd avatar May 03 '22 06:05 bekatd

Also please post screenshot from android studio, what went wrong exactly

bekatd avatar May 03 '22 06:05 bekatd

Try to run gradlew clean and delete node modules. Also if you have old expo unimodules installation, try to migrate to new expo modules

Yes, did all of above.

  • Android Clean gradle
  • Rebuild gradle
  • Remove all node packages and install from scratch
  • Android studio Invalidate cache & Restart

But even after all these, got this error

Screenshot 2022-05-03 at 12 04 12 PM

dhavallogistic avatar May 03 '22 06:05 dhavallogistic

But error you posted can't happen in case of 2.13.0. You are trying to install 2.13.2 right?

bekatd avatar May 03 '22 06:05 bekatd

I had exact same error and resolved by downgrading to 2.13.0

bekatd avatar May 03 '22 06:05 bekatd

But error you posted can't happen in case of 2.13.0. You are trying to install 2.13.2 right?

No, I tested with version 2.13.0

Screenshot 2022-05-03 at 12 18 46 PM

dhavallogistic avatar May 03 '22 06:05 dhavallogistic

I had exact same error and resolved by downgrading to 2.13.0

Yes I saw your post and solution you gave. And I also tried to implement it and after all that trial and error I got this result with all versions. Only working version is 2.11.2 and that is also with old node packages. Otherwise no luck :(

dhavallogistic avatar May 03 '22 06:05 dhavallogistic

But simply v2.13.0 does not have the code you are showing on screenshot of error

bekatd avatar May 03 '22 07:05 bekatd

You mean to say, the file I am getting an error called FrameProcessorRuntimeManage.kt is not included in v2.13.0?

dhavallogistic avatar May 03 '22 07:05 dhavallogistic

Yes. You are somehow installing latest version instead of 2.13.0

Here is the link to source of that file from v2.13.0 https://github.com/mrousavy/react-native-vision-camera/blob/65d4d46f6ab4e04dca15c15b8cf9c07a17f97d72/android/src/main/java/com/mrousavy/camera/frameprocessor/FrameProcessorRuntimeManager.kt

bekatd avatar May 03 '22 07:05 bekatd

Just delete node_modules, edit lib version in package.json to 2.13.0, run yarn or npm, run gradlew clean and thats it

bekatd avatar May 03 '22 07:05 bekatd

That is a RN version error, are you on 0.67?

mrousavy avatar May 05 '22 08:05 mrousavy

Same problem. Have any suggestions??

Venglevskyi avatar May 16 '22 13:05 Venglevskyi

Same problem. Have any suggestions??

In my case below solutions is working..

  1. Remove all node files
  2. npm i
  3. Try to install with particular version like.. npm i [email protected]

dhavallogistic avatar May 16 '22 13:05 dhavallogistic

Downgrading to 2.13.0 works fine for both android and iOS but some features like zoom and auto light adjustment wont work on iOS which are actually available in 2.13.3

MuhammadAbdullah54321 avatar May 27 '22 11:05 MuhammadAbdullah54321

Downgrading to version 2.13.0 works fine.

aniruddhashevle avatar Jul 13 '22 00:07 aniruddhashevle

+1

ajithes1 avatar Aug 04 '22 10:08 ajithes1

Facing same failed condition!

Tried lower versions but that didn't help.

Android React Native: 0.61.5 Vision Camera: 2.14.1

SpectreWulf avatar Aug 23 '22 05:08 SpectreWulf

Facing same failed condition!

Tried lower versions but that didn't help.

Android React Native: 0.61.5 Vision Camera: 2.14.1

May be you should try to upgrade React Native version

MuhammadAbdullah54321 avatar Aug 23 '22 06:08 MuhammadAbdullah54321