Open vinovarkey opened 6 years ago
What version of RocksDB are you using?
@promethe42 was able to successfully build RocksDB targeting Android as mentioned here: https://github.com/facebook/rocksdb/issues/1193#issuecomment-411318485 , after a bug fix that he did in #4231 .
@sagar0 building yes, testing no... at least not yet! I'll report here ASAP.
any update on this issue? were you able to get it to run?
Yes. We got it to run without trouble. So I can't reproduce.
I ran into the same issue with ROCKSDB_LITE build. Then I realized my project does not have ROCKSDB_LITE compiler definition. https://github.com/facebook/rocksdb/blob/327c4807a7fe8532326323e2753670daf06a0f6b/include/rocksdb/options.h#L994-L1001 add_definitions() only adds definitions to rocksdb project, not the user projects. Suggest to add target_compile_definitions() in the CMAKE config. https://github.com/facebook/rocksdb/blob/327c4807a7fe8532326323e2753670daf06a0f6b/CMakeLists.txt#L393-L396
@Domos I almost went insane. Thank you!
Team,
I have compiled rocksdb for Android using the following cmake command
followed by a
$ANDROID_CMAKE --build /path/containing/CMakeCache.txt
I have bundled the resulting librocksdb.so into a sample Android app. I have the following JNI code snippet which crashes
The crash exception trace is
I have been able to reproduce the crash with a much simpler code than
DB::Open(options, str, &db)
:After stepping through the code above, I have noticed the exception occurs when initializing
AdvancedColumnFamilyOptions
'sstd::vector<int> max_bytes_for_level_multiplier_additional =std::vector<int>(num_levels, 1);
Here is the screenshot after stepping through the code
Here is the max_size() output from debugger
And here is the backtrace at this point in time
libnative.so
is where the JNI code is bundled into.As suggested in https://github.com/facebook/rocksdb/issues/2809, I have tried the .so build with and without the
ROCKSDB_LITE
option. I still run into the same crash.Any ideas on how I can proceed further?