-
-
Notifications
You must be signed in to change notification settings - Fork 907
Update for React Native 0.78+ Compatibility: Enforce Stricter Kotlin Checks & Migrate to setViewTreeLifecycleOwner API #3816
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
Conversation
… potential crashes
android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks much for the PR!, can you please add error logging ? So we don't just skip processing when it's null but we log some error. I think non of the changed place is expected to be null
…fecycle management
…s to improve error logging
Added Error Logs |
…le for improved debugging
android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSourceManager.kt
Outdated
Show resolved
Hide resolved
@ShahilMangroliya Can you update the description? Is this PR to prevent crashes? Or to enable building with 0.78.1, which has more strict kotlin checking I assume |
…leMap with logging for better debugging
Updated description |
Done |
Can we approve this please? |
@mfazekas Much needed PR. Can we expedite the process, or how can I help? |
@@ -6,7 +6,7 @@ import android.graphics.drawable.BitmapDrawable | |||
import android.graphics.drawable.Drawable | |||
import android.view.View | |||
import com.facebook.react.bridge.* | |||
import com.facebook.react.common.MapBuilder | |||
//import com.facebook.react.common.MapBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls remove instead of commenting
@@ -119,7 +119,7 @@ class RNMBXShapeSourceManager(private val mContext: ReactApplicationContext, val | |||
) | |||
ReadableType.Boolean -> Expression.literal(expressions.getBoolean(iExp)) | |||
ReadableType.Number -> Expression.literal(expressions.getDouble(iExp)) | |||
else -> Expression.literal(expressions.getString(iExp)) | |||
else -> expressions.getString(iExp)?.let { Expression.literal(it) }!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a log here as well?
@@ -46,8 +46,8 @@ fun ReadableArray.toJsonArray() : JsonArray { | |||
val result = JsonArray(size()) | |||
for (i in 0 until size()) { | |||
when (getType(i)) { | |||
ReadableType.Map -> result.add(getMap(i).toJsonObject()) | |||
ReadableType.Array -> result.add(getArray(i).toJsonArray()) | |||
ReadableType.Map -> result.add(getMap(i)?.toJsonObject()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls log here as well
@ShahilMangroliya pls look into ci failures as well |
@mfazekas @ShahilMangroliya Guys, let's speed up the process please. Too many people are waiting for this. |
See: #3855 it's released as |
Description
fix(android): support RN 0.78.0+
This PR addresses compatibility with React Native 0.78.0+ by enforcing stricter Kotlin checks, which are required for RN 0.78.0+. These changes ensure the module works reliably with the newer RN versions and prevent potential crashes due to Kotlin mismatch or type-safety issues.
Additionally, this PR updates the usage of
ViewTreeLifecycleOwner.set(view, lifecycleOwner);
to the newer and preferred API:view.setViewTreeLifecycleOwner(lifecycleOwner)
.Fixes #3815
Checklist
CONTRIBUTING.md
yarn generate
in the root folder/example
app./example
)