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

feat: Upgrade CameraX #2782

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/docs/guides/FRAME_PROCESSORS_SKIA.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ npm i @shopify/react-native-skia
npm i react-native-reanimated
```

Since the Skia integration is powered by C++ HardwareBuffers, set your Android's `minSdkVersion` to `26` or higher.

## Skia Frame Processors

A Skia Frame Processor, just like any other [Frame Processor](/docs/guides/frame-processors), runs synchronously for every Camera Frame.
Expand Down
2 changes: 1 addition & 1 deletion package/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ dependencies {
implementation "com.facebook.react:react-android:+"

// CameraX dependency
def camerax_version = "1.4.0-alpha04"
def camerax_version = "1.4.0-alpha05"
implementation "androidx.camera:camera-core:${camerax_version}"
implementation "androidx.camera:camera-camera2:${camerax_version}"
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
Expand Down
2 changes: 1 addition & 1 deletion package/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ org.gradle.configureondemand=true
# 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
VisionCamera_kotlinVersion=1.8.0
android.enableJetifier=true
android.useAndroidX=true
4 changes: 2 additions & 2 deletions package/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply plugin: "kotlin-android"

import com.android.build.OutputFile

Expand Down Expand Up @@ -97,6 +97,7 @@ def reactNativeArchitectures() {

android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdkVersion rootProject.ext.compileSdkVersion

namespace "com.mrousavy.camera.example"
Expand Down Expand Up @@ -160,7 +161,6 @@ android {
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

if (hermesEnabled.toBoolean()) {
Expand Down
7 changes: 4 additions & 3 deletions package/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ buildscript {
minSdkVersion = 26
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "23.1.7779620"
ndkVersion = "25.1.8937393"
kotlinVersion = "1.8.0"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:7.4.1')
classpath('com.android.tools.build:gradle:7.4.2')
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
}
Loading