Ha Ngo
Ha Ngo

Reputation: 23

Expo-camera: compileDebugKotlin FAILED

I had this error when trying to build expo app on Android with expo-camera@14.0.6. It works fine on IOS.

error

> Task :expo-camera:compileDebugKotlin
e: file:///.../app/node_modules/expo-camera/android/src/main/java/expo/modules/camera/ExpoCameraView.kt:279:25 Unresolved reference: raw
e: file:///.../app/node_modules/expo-camera/android/src/main/java/expo/modules/camera/next/ExpoCameraView.kt:424:25 Unresolved reference: raw
e: file:///.../app/node_modules/expo-camera/android/src/main/java/expo/modules/camera/next/analyzers/BarcodeAnalyzer.kt:54:81 Type mismatch: inferred type is String? but (Mutable)List<Int!>! was expected
e: file:///.../app/node_modules/expo-camera/android/src/main/java/expo/modules/camera/next/analyzers/BarcodeAnalyzer.kt:54:86 Type mismatch: inferred type is MutableList<Int> but Int was expected
e: file:///.../app/node_modules/expo-camera/android/src/main/java/expo/modules/camera/next/analyzers/BarcodeAnalyzer.kt:54:113 Too many arguments for public constructor BarCodeScannerResult(p0: Int, p1: String!, p2: (Mutable)List<Int!>!, p3: Int, p4: Int) defined in expo.modules.interfaces.barcodescanner.BarCodeScannerResult

> Task :expo-camera:compileDebugKotlin FAILED

Some info: package.json

    "expo": "^50.0.6",
    "expo-camera": "14.0.6",
    "react-native": "0.73.4",

app.json

{ expo: {
"plugins": [ 
      [ "expo-camera", 
        { 
          "cameraPermission": "Allow $(PRODUCT_NAME) to access your camera", 
          "microphonePermission": "Allow $(PRODUCT_NAME) to access your microphone", 
          "recordAudioAndroid": true 
        } 
      ]
    ]
}
}

I tried multiple solutions found online but none of it worked. What I did:

Upvotes: 0

Views: 857

Answers (4)

Entireno
Entireno

Reputation: 1

having this same issue today with:

"expo": "~52.0.25",
"react-native": "0.76.6",
"expo-camera": "~16.0.12",

"expo-camera": "~16.0.13", released 15 minutes ago If you want, try it with that one

Upvotes: 0

Facundo
Facundo

Reputation: 13

having this same issue today with:

"expo": "~52.0.25",
"react-native": "0.76.6",
"expo-camera": "~16.0.12",

Upvotes: 0

Also solved this by upgrading expo version from 50.0.6 to 50.0.11.

Upvotes: 0

Ha Ngo
Ha Ngo

Reputation: 23

Solved this by upgrading expo version from 50.0.6 to 50.0.11.

The problem was that the expo-modules-core dependency in version 50.0.6 doesn't include the changes that are need for expo-camera/next

Upvotes: 1

Related Questions