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

chore: bump iOS and Android dependencies to get latest bug fixes #232

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ android {
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
buildToolsVersion getExtOrDefault('buildToolsVersion')
defaultConfig {
minSdkVersion 21
minSdkVersion 24
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solved the following error:

Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform rive-android-9.2.2.aar (app.rive:rive-android:9.2.2) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}.
      > Execution failed for DexingWithClasspathTransform: /Users/philrive/.gradle/caches/transforms-3/defcb3a484b64167fc84e6cd1cef719b/transformed/jetified-rive-android-9.2.2-runtime.jar.
         > Error while dexing.
   > Failed to transform kotlin-stdlib-1.9.22.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.22) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.jvm.environment=standard-jvm, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
      > Execution failed for DexingWithClasspathTransform: /Users/philrive/.gradle/caches/transforms-3/755bc55d71b5f70c0d2fe3d2d5f63094/transformed/jetified-kotlin-stdlib-1.9.22.jar.
         > Error while dexing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we don't need to update the minSDKVersion here, and it'll only be needed in the example/build.gradle to get the example compiling.

I also suspect that there is just some other config we need to update in the example project, instead of bumping the minSDK.

targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -135,7 +135,7 @@ dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
implementation 'app.rive:rive-android:8.7.0'
implementation 'app.rive:rive-android:9.2.2'
Copy link
Contributor

@umberto-sonnino umberto-sonnino Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀
Although, I think the latest is 9.3.0?

implementation "androidx.startup:startup-runtime:1.1.1"
implementation 'com.android.volley:volley:1.2.0'
}
12 changes: 5 additions & 7 deletions android/src/main/java/com/rivereactnative/RiveReactNativeView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.annotation.CallSuper
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.LifecycleOwner
import app.rive.runtime.kotlin.PointerEvents
import app.rive.runtime.kotlin.renderers.PointerEvents
import app.rive.runtime.kotlin.RiveAnimationView
import app.rive.runtime.kotlin.controllers.RiveFileController
import app.rive.runtime.kotlin.core.*
Expand Down Expand Up @@ -158,7 +158,7 @@ class RiveReactNativeView(private val context: ThemedReactContext) : FrameLayout

override fun onDetachedFromWindow() {
if (willDispose) {
riveAnimationView?.dispose();
riveAnimationView.dispose();
}

super.onDetachedFromWindow()
Expand Down Expand Up @@ -301,16 +301,16 @@ class RiveReactNativeView(private val context: ThemedReactContext) : FrameLayout
}

fun touchBegan(x: Float, y: Float) {
riveAnimationView.artboardRenderer?.pointerEvent(PointerEvents.POINTER_DOWN, x, y)
riveAnimationView.controller.pointerEvent(PointerEvents.POINTER_DOWN, x, y)
}

fun touchEnded(x: Float, y: Float) {
riveAnimationView.artboardRenderer?.pointerEvent(PointerEvents.POINTER_UP, x, y)
riveAnimationView.controller.pointerEvent(PointerEvents.POINTER_UP, x, y)
}

fun setTextRunValue(textRunName: String, textValue: String) {
try {
riveAnimationView.artboardRenderer?.activeArtboard?.textRun(textRunName)?.text = textValue;
riveAnimationView.controller.activeArtboard?.textRun(textRunName)?.text = textValue;
} catch (ex: RiveException) {
handleRiveException(ex)
}
Expand Down Expand Up @@ -459,13 +459,11 @@ class RiveReactNativeView(private val context: ThemedReactContext) : FrameLayout

fun setAnimationName(animationName: String) {
this.animationName = animationName
riveAnimationView.artboardRenderer?.animationName = animationName
shouldBeReloaded = true
}

fun setStateMachineName(stateMachineName: String) {
this.stateMachineName = stateMachineName
riveAnimationView.artboardRenderer?.stateMachineName = stateMachineName
shouldBeReloaded = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class RiveReactNativeViewManager : SimpleViewManager<RiveReactNativeView>() {

"play" -> {
args?.let {
val animationName = it.getString(0)!!
val loopMode = it.getString(1)!!
val direction = it.getString(2)!!
val animationName = it.getString(0)
val loopMode = it.getString(1)
val direction = it.getString(2)
val isStateMachine = it.getBoolean(3)
view.run {
val rnLoopMode = RNLoopMode.mapToRNLoopMode(loopMode)
Expand All @@ -43,17 +43,17 @@ class RiveReactNativeViewManager : SimpleViewManager<RiveReactNativeView>() {

"fireState" -> {
args?.let {
val stateMachineName = it.getString(0)!!
val inputName = it.getString(1)!!
val stateMachineName = it.getString(0)
val inputName = it.getString(1)
view.run {
fireState(stateMachineName, inputName)
}
}
}
"setBooleanState" -> {
args?.let {
val stateMachineName = it.getString(0)!!
val inputName = it.getString(1)!!
val stateMachineName = it.getString(0)
val inputName = it.getString(1)
val value = it.getBoolean(2)
view.run {
setBooleanState(stateMachineName, inputName, value)
Expand All @@ -62,8 +62,8 @@ class RiveReactNativeViewManager : SimpleViewManager<RiveReactNativeView>() {
}
"setNumberState" -> {
args?.let {
val stateMachineName = it.getString(0)!!
val inputName = it.getString(1)!!
val stateMachineName = it.getString(0)
val inputName = it.getString(1)
val value = it.getDouble(2)
view.run {
setNumberState(stateMachineName, inputName, value.toFloat())
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 21
minSdkVersion = 24
compileSdkVersion = 34
targetSdkVersion = 34
kotlinVersion = "1.8.10"
Expand Down
2 changes: 1 addition & 1 deletion ios/utility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func importRiveFile(from url: URL) throws -> RiveFile {
}
let pointer = rawPointer.bindMemory(to: UInt8.self, capacity: bytes.count)

let riveFile = try RiveFile(bytes:pointer, byteLength: UInt64(bytes.count))
let riveFile = try RiveFile(bytes:pointer, byteLength: UInt64(bytes.count), loadCdn: true)
return riveFile
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rive-react-native",
"version": "6.2.3",
"version": "6.3.0",
"description": "Rive React Native",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
2 changes: 1 addition & 1 deletion rive-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,mm,swift}"

s.dependency "React-Core"
s.dependency "RiveRuntime", "5.5.1"
s.dependency "RiveRuntime", "5.10.0"
end
Loading