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

fix(Android): Kotlin build issues with RN 0.75.3 #7913

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

siddarthkay
Copy link

Summary

This PR fixes the following Kotlin build issues which were discovered after I upgraded react-native to 0.75.3 and react-native-navigation to 7.40.1

> Task :react-native-navigation:compileReactNative71DebugKotlin FAILED
e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/
utils/ReactViewGroup.kt:7:59 Unresolved reference: fullBorderRadius

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/
viewcontrollers/viewcontroller/LayoutDirectionApplier.kt:11:45 Smart cast to 'ReactContext' is impossible, 
because 'instanceManager.currentReactContext' is a property that has open or custom getter

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/
viewcontrollers/viewcontroller/LayoutDirectionApplier.kt:12:45 Smart cast to 'ReactContext' is impossible, 
because 'instanceManager.currentReactContext' is a property that has open or custom getter

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/
react/modal/ModalContentLayout.kt:53:56 Type mismatch: inferred type is MotionEvent? 
but MotionEvent was expected

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/
react/modal/ModalContentLayout.kt:53:70 Type mismatch: inferred type is EventDispatcher? 
but EventDispatcher was expected

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/
react/modal/ModalContentLayout.kt:56:56 Type mismatch: inferred type is MotionEvent? 
but MotionEvent was expected

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/
react/modal/ModalContentLayout.kt:56:70 Type mismatch: inferred type is EventDispatcher? 
but EventDispatcher was expected

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/
react/modal/ModalContentLayout.kt:59:54 Type mismatch: inferred type is MotionEvent? 
but MotionEvent was expected

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/
react/modal/ModalContentLayout.kt:59:68 Type mismatch: inferred type is EventDispatcher? 
but EventDispatcher was expected

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/
react/modal/ModalContentLayout.kt:77:45 Type mismatch: inferred type is MotionEvent? 
but MotionEvent was expected

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/
react/modal/ModalContentLayout.kt:77:52 Type mismatch: inferred type is EventDispatcher? 
but EventDispatcher was expected

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/
react/modal/ModalContentLayout.kt:82:45 Type mismatch: inferred type is MotionEvent? 
but MotionEvent was expected

e: file:///private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/
react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/
react/modal/ModalContentLayout.kt:82:52 Type mismatch: inferred type is EventDispatcher? 
but EventDispatcher was expected

fixes: #7905, #7911

@siddarthkay siddarthkay force-pushed the fix-android-build-issues-with-react-native-75 branch from 134ba34 to 21811c0 Compare September 17, 2024 03:49
@siddarthkay
Copy link
Author

I found 2 new errors :

> Task :react-native-navigation:compileReactNative71DebugJavaWithJavac
/private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/react-native-navigation/lib/
android/app/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java:99: 
error: cannot find symbol
        || ((oldStyle & Typeface.BOLD) != 0 && weight == ReactTextShadowNode.UNSET)) {
                                                                            ^
  symbol:   variable UNSET
  location: class ReactTextShadowNode
/private/tmp/nix-build-status-mobile-build-debug-android.drv-3/node_modules/react-native-navigation/lib/
android/app/src/main/java/com/reactnativenavigation/
utils/ReactTypefaceUtils.java:104: error: cannot find symbol
        || ((oldStyle & Typeface.ITALIC) != 0 && style == ReactTextShadowNode.UNSET)) {
                                                                             ^
  symbol:   variable UNSET
  location: class ReactTextShadowNode

@siddarthkay siddarthkay force-pushed the fix-android-build-issues-with-react-native-75 branch from d510996 to f1bae0f Compare September 17, 2024 04:52
@zabojad
Copy link
Contributor

zabojad commented Sep 23, 2024

I've just tested it and got:

e: file:///Users/thomasfetiveau/wksp_olap/OlapRN75/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt:16:2 Missing '}

@siddarthkay
Copy link
Author

@zabojad : probably you missed a } while applying this patch.
I could see builds passing here without any syntax errors -> status-im/status-mobile#21268

@zabojad
Copy link
Contributor

zabojad commented Sep 24, 2024

hey @siddarthkay ! I've applyied the fix directly from this PR (I did not change any file manually before testing it). Also, when double checking the files of this PR, we see the missing '}' there:

Screenshot 2024-09-24 at 09 56 53

Anyway... It's not a big deal, I just wanted to tell you so that you fix your PR...

@Luanluu96
Copy link

Luanluu96 commented Oct 2, 2024

in react-native-reanimated resolved like this
as border Radius is not the same with fullBorderWidth

val ReactViewGroup.borderRadius: Float
    get(){
        val uniform: LengthPercentage = (background as? CSSBackgroundDrawable)?.borderRadius?.uniform
            ?: return 0f

        return uniform.resolve(
            width.toFloat(), height.toFloat()
        )
    }

@MaxMaesLW
Copy link

Any chance this can get verified and merged? I've ran into this issue in a project I'm working on and am kind of blocked until this is resolved.

@zzorba
Copy link
Contributor

zzorba commented Dec 8, 2024

Second that, any hope this can get merged? Not being able to use the two most recent versions of RN is pretty rough.

@DriesVS
Copy link

DriesVS commented Dec 28, 2024

@asafkorem can you check this one please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

React Native 0.75.x
6 participants