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

[React Native][Android] error: use of undeclared identifier 'assert' #1138

Open
kaxline opened this issue Aug 14, 2021 · 1 comment
Open

Comments

@kaxline
Copy link

kaxline commented Aug 14, 2021

I've just ran into the following build errors using Gradle 7.1.1 and [email protected]:

ProjectRoot/node_modules/@nozbe/watermelondb/native/android-jsi/src/main/cpp/DatabasePlatformAndroid.cpp:71:5: error: use of undeclared identifier 'assert'
      assert(env);
      ^
  ProjectRoot/node_modules/@nozbe/watermelondb/native/android-jsi/src/main/cpp/DatabasePlatformAndroid.cpp:76:5: error: use of undeclared identifier 'assert'
      assert(jvm);
      ^
  ProjectRoot/node_modules/@nozbe/watermelondb/native/android-jsi/src/main/cpp/DatabasePlatformAndroid.cpp:81:5: error: use of undeclared identifier 'assert'
      assert(jvm);
      ^
  ProjectRoot/node_modules/@nozbe/watermelondb/native/android-jsi/src/main/cpp/DatabasePlatformAndroid.cpp:85:5: error: use of undeclared identifier 'assert'
      assert(env);
      ^
  4 errors generated.

And I was able to fix it by adding

#include <cassert>

To the top of /native/android-jsi/src/main/cpp/DatabasePlatformAndroid.cpp

It's probably related to my local environment, but posting here just in case it helps someone else. Is there any downside to adding that #include statement to the project file? If not it seems like an easy fix ...

@diegolmello
Copy link

Fixed on #1198

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

2 participants