question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?

See original GitHub issue

I’ve created a new React-Native project (0.59-RC3) and installed the newest WatermelonDB. iOS is working fine but Android won’t compile. I’m getting those errors:

e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (196, 37): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (200, 50): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (201, 50): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (202, 49): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (202, 61): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (206, 50): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (207, 47): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (208, 50): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (209, 49): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (209, 61): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (213, 50): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (214, 47): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (218, 50): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?
e: SomeRandomFilePath/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/DatabaseBridge.kt: (219, 47): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ReadableArray?

I could add some more information, but don’t know which one you want, please let me know.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
rozPierogcommented, Mar 4, 2019

Yup, its braking change in 0.59: https://github.com/facebook/react-native/commit/b640b6f I will create PR later this week with fix for this. @vdlindenmark thanks for reporting!

1reaction
vdlindenmarkcommented, Mar 11, 2019

@rozPierog Nice! The app now build 😃 So I could start to change all Realm code to WatermelonDB 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Only safe or non null assserted calls are allowed on a nullable ...
The problem is, that you defined the ArrayList as nullable . You have two options here: don't define the variable nullable (this depends...
Read more >
Safe calls(?.) vs Null checks(!!) in Kotlin - Suneet Agrawal
In Kotlin, the type system distinguishes between references that can hold null (nullable references) and those that can not (non-null references).
Read more >
"Only safe or null-asserted calls are allowed on nullable ...
"Only safe or null-asserted calls are allowed on nullable receiver" after converting Java code with Map#get as receciver that would throw an exception...
Read more >
Only safe (?.) or non-null asserted (!!.) calls are allowed on a ...
It would appear that AuthResult? is a nullable type (returned from it.result / it.getResult() ) which is a fundamental concept of Kotlin. That...
Read more >
Kotlin and null safety: Yet Again! | by Vinay Joglekar - Medium
or non-null asserted (!!.) calls are allowed on a nullable receiver of type User? user?.name = "Vinay". This is how you null- check...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found