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

Created on 3 Mar 2019  路  7Comments  路  Source: Nozbe/WatermelonDB

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.

Most helpful comment

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!

All 7 comments

Sounds like a Kotlin version mismatch? @rozpierog

Or maybe RN 0.59 changed The API...

@radex It's not unthinkable that RN changed some API's. If I'm right there are a lot of Android changes.
I've created a brand new empty RN.059-RC3 app with WatermelonDB, followed the installation docs and also getting this error (so none complications with other packages).

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!

I just sat to resolve this issue but I noticed that it is already resolved on master thanks to @kilbot https://github.com/Nozbe/WatermelonDB/commit/3ad651e33a9b215c396611ef365d237a1a9236b3
I forgot that I've merged his PR sorry about confusion and thanks to @kilbot for his PR.
@vdlindenmark please check out Watermelon 0.10.2-1

That sounds great! I will check it this Monday! :)

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

giniedp picture giniedp  路  4Comments

jdnichollsc picture jdnichollsc  路  4Comments

mikebeyer picture mikebeyer  路  7Comments

markorusic picture markorusic  路  4Comments

binbinla picture binbinla  路  3Comments