Skip to content

[Android] CBL throws error from RN 79 to 81 #72

Description

@soyaaroncervantes

Problem

Android build fails with Kotlin compilation errors in DataAdapter.kt when using React Native 0.79.6. This is the same issue that was fixed in PR #66

I created an isolated project following same steps as #64 , added the initial Android steps described here, and didn't work for React Native latest version too, shows same error

Environment

  • React Native: 0.79.6 - 0.81.4
  • cbl-reactnative: 0.6.1
  • Platform: Android

Error

> Task :cbl-reactnative:compileDebugKotlin FAILED

[Incubating] Problems report is available at: file:///C:/{{user_path}}/cblProject/android/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.14.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
70 actionable tasks: 8 executed, 62 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor 

No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.
e: file:///C:/{{user_path}}/cblProject/node_modules/cbl-reactnative/android/src/main/java/com/cblreactnative/DataAdapter.kt:127:45 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'ReadableArray?'.
e: file:///C:/{{user_path}}/cblProject/node_modules/cbl-reactnative/android/src/main/java/com/cblreactnative/DataAdapter.kt:128:31 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'ReadableArray?'.
e: file:///C:/{{user_path}}/cblProject/node_modules/cbl-reactnative/android/src/main/java/com/cblreactnative/DataAdapter.kt:129:62 Argument type mismatch: actual type is 'String?', but 'String' was expected.
e: file:///C:/{{user_path}}/cblProject/node_modules/cbl-reactnative/android/src/main/java/com/cblreactnative/DataAdapter.kt:135:45 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'ReadableArray?'.
e: file:///C:/{{user_path}}/cblProject/node_modules/cbl-reactnative/android/src/main/java/com/cblreactnative/DataAdapter.kt:136:31 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'ReadableArray?'.
e: file:///C:/{{user_path}}/cblProject/node_modules/cbl-reactnative/android/src/main/java/com/cblreactnative/DataAdapter.kt:137:68 Argument type mismatch: actual type is 'String?', but 'String' was expected.
e: file:///C:/{{user_path}}/cblProject/node_modules/cbl-reactnative/android/src/main/java/com/cblreactnative/DataAdapter.kt:529:12 Return type mismatch: expected 'Map<String, Any>', actual 'HashMap<String, Any?>'.

FAILURE: Build failed with an exception.

Steps to Reproduce

  1. bunx @react-native-community/cli@latest init cblProject
  2. cd cblProject
  3. bun add cbl-reactnative
  4. bunx react-native run-android

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions