mrousavy / react-native-vision-camera

πŸ“Έ A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.54k stars 1.09k forks source link

πŸ› Mass amount of Unresolved reference when update to v3 #1712

Closed lninnnn closed 1 year ago

lninnnn commented 1 year ago

What were you trying to do?

Updated from 2.15.4 to 3.0.0-rc.5

Reproduceable Code

"react-native": "0.71.8",
"react-native-worklets": "github:chrfalch/react-native-worklets#d62d76c",
//tried to use react-native-worklet-core but the package is not linked in cMake and build.gradle yet (still use the old name)
"react-native-vision-camera": "3.0.0-rc.5",
"@shopify/react-native-skia": "^0.1.202",

What happened instead?

Build fail

Build.gradle

buildToolsVersion = "33.0.0"
        minSdkVersion = 28 // or higher
        compileSdkVersion = 33
        targetSdkVersion = 33
        androidXCore = "1.0.2"
        playServicesVersion = "17.0.0"
        RNNKotlinVersion = "1.7.20" 
        RNNKotlinStdlib = "kotlin-stdlib-jdk8"
        kotlinVersion = "1.7.20" 
        ndkVersion = "21.4.7075529"

Relevant log output

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
.../android/src/main/java/com/mrousavy/camera/extensions/MediaFormat.setDynamicRangeProfile.kt: (3, 40): Unresolved reference: DynamicRangeProfiles

../react-native-vision-camera/android/src/main/java/com/mrousavy/camera/extensions/MediaFormat.setDynamicRangeProfile.kt: (34, 54): Unresolved reference: TIRAMISU

react-native-vision-camera/android/src/main/java/com/mrousavy/camera/extensions/MediaFormat.setDynamicRangeProfile.kt: (35, 63): Unresolved reference: FEATURE_HdrEditing
../node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/extensions/Size+Extensions.kt: (12, 10): Unresolved reference: minBy

../react-native-vision-camera/android/src/main/java/com/mrousavy/camera/extensions/Size+Extensions.kt: (12, 22): Unresolved reference: it

../react-native-vision-camera/android/src/main/java/com/mrousavy/camera/parsers/VideoStabilizationMode.kt: (5, 48): Unresolved reference: CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION

../react-native-vision-camera/android/src/main/java/com/mrousavy/camera/utils/CameraDeviceDetails.kt: (68, 54): Unresolved reference: TIRAMISU

../react-native-vision-camera/android/src/main/java/com/mrousavy/camera/utils/CameraDeviceDetails.kt: (69, 48): Unresolved reference: REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT
../react-native-vision-camera/android/src/main/java/com/mrousavy/camera/utils/CameraDeviceDetails.kt: (70, 49): Not enough information to infer type variable T

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

Device

Android

VisionCamera Version

3.0.0-rc05

Additional information

ObidosDev commented 1 year ago

Same for me

node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/extensions/Size+Extensions.kt: (12, 10): Unresolved reference: minBy
ObidosDev commented 1 year ago

To fix this need to update kotlinVersion = '1.7.20'

t4dek commented 1 year ago

@ObidosDev where exactly should we set kotlinVersion = '1.7.20' ?

Because I see the code inside library that is doing it already if I am not mistaken.

def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['VisionCamera_kotlinVersion']

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Fri Feb 19 20:46:14 CET 2021
VisionCamera_kotlinVersion=1.7.20
android.enableJetifier=true
android.useAndroidX=true
lninnnn commented 1 year ago

To fix this need to update kotlinVersion = '1.7.20'

my build gradle (check above) is already declared kotlinVerson = 1.7.20

lninnnn commented 1 year ago

@mrousavy Hi! Do you have time to look into this?

mrousavy commented 1 year ago

Hi! No, why?

keisan1231 commented 1 year ago

node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/extensions/Size+Extensions.kt: (12, 10):

Unresolved reference: minBy

Android Studio. This errorπŸ˜…

"react-native-vision-camera": "^3.0.0",

mrousavy commented 1 year ago

Closing as this is a stale issue - this might have been fixed with the full rewrite in VisionCamera V3 (πŸ₯³) - if not, please create a new issue.

If your issue has been fixed, consider sponsoring me on GitHub to say thanks πŸ’–

interstates21 commented 11 months ago

It's not fixed in 3.6.4

Upd: ext.kotlinVersion = '1.7.20' in build.gradle helped!

I was overriding this kotlinVersion somewhere else πŸ₯²