Skip to content

Not compatible with react native 0.79.0 #988

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

Closed
PedroPerpetua opened this issue Apr 10, 2025 · 6 comments
Closed

Not compatible with react native 0.79.0 #988

PedroPerpetua opened this issue Apr 10, 2025 · 6 comments

Comments

@PedroPerpetua
Copy link

Description

file:///<project_root>/node_modules/react-native-pager-view/android/src/fabric/java/com/reactnativepagerview/PagerViewViewManager.kt:41:40 Argument type mismatch: actual type is 'kotlin.String?', but 'kotlin.String' was expected.

This appears to be related with this commit on react-native.

@NewcodeTechnology
Copy link

I am also having the same issue on

"react-native": "0.79.0",
"react-native-pager-view": "^6.7.0"

react-native-pager-view:compileReleaseKotlin FAILED
react-native-pager-view/android/src/fabric/java/com/reactnativepagerview/PagerViewViewManager.kt:41:40 Argument type mismatch: actual type is 'kotlin.String?', but 'kotlin.String' was expected.

@namekemty
Copy link

Hey, u can temporary use this solution. Worked for me

node_modules/react-native-pager-view/android/src/fabric/java/com/reactnativepagerview/PagerViewViewManager.kt

40 | -  override fun receiveCommand(root: NestedScrollableHost, commandId: String?, args: ReadableArray?) {
40 | +  override fun receiveCommand(root: NestedScrollableHost, commandId: String, args: ReadableArray?)

@KunaalMangal
Copy link

The Issue Resolved for now

The problem was due to the commandId being declared as a nullable type (String?). After updating it to a non-nullable String, the issue no longer occurs.

File:
node_modules/react-native-pager-view/android/src/fabric/java/com/reactnativepagerview/PagerViewViewManager.kt

Previous Code:

override fun receiveCommand(root: NestedScrollableHost, commandId: String?, args: ReadableArray?) {
    mDelegate.receiveCommand(root, commandId, args)
}

Updated Code:

override fun receiveCommand(root: NestedScrollableHost, commandId: String, args: ReadableArray?) {
    mDelegate.receiveCommand(root, commandId, args)
}

✅ After removing the ? from String?, the method works correctly with the expected behavior.


@azizbecha
Copy link

Unfortunately, you have to do this every time you build your app which takes too long.
This should be fixed in a new release.

@FernandoAOborges
Copy link

Unfortunately, you have to do this every time you build your app which takes too long. This should be fixed in a new release.

Yes, I had the same issue. The fix is simple:
You just need to replace this line in PagerViewViewManager.kt:

override fun receiveCommand(root: NestedScrollableHost, commandId: String?, args: ReadableArray?)

with:

override fun receiveCommand(root: NestedScrollableHost, commandId: String, args: ReadableArray?)

Then, generate a patch using patch-package, so you don’t have to edit this manually every time.

@MrRefactor
Copy link
Collaborator

fixed in 6.7.1 version

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

No branches or pull requests

7 participants