Assertion "terminating with uncaught exception of type CppSQLite3Exception" failed

Hi, i use sqlite and cocos2dx v4 with cmake, I do not know what error occurred, I hope there is someone who can help me thanks.

You will need to post more details. This is too vague.

I use cocos2dxv4 with CMake and sqlite encryption with wxSqlite from , but when I run it, my game immediately stops with an error log like /Volumes/Android/buildbot/src/android/ndk-release-r21/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:72: abort_message: assertion "terminating with uncaught exception of type CppSQLite3Exception" failed

here is my code when call sqlite:
`sqlite3 *database = NULL;
if ((sqlite3_open(dbpath.c_str(), &database) != SQLITE_OK)) {
CCLOG(“database open error”);
sqlite3_key(database, DB_PASSPHRASE, (int)strlen(DB_PASSPHRASE));

std::string path = FileUtils::getInstance()->fullPathForFilename(DB_RESOURCE_SQL_FILE);
std::string sql = FileUtils::getInstance()->getStringFromFile(path);
CCLOG("SQL path : %s", path.c_str());
CCLOG("CREATE SQL: %s", sql.c_str());

if (sqlite3_exec(database, sql.c_str(), 0, 0, NULL)==SQLITE_OK) {
    CCLOG("create tables and insert data done");
} else {
    CCLOG("error create sql, %s", sqlite3_errmsg(database));

This doesn’t have anything to do with cocos2d-x. Add the exception, probably a try/catch you are missing.

Is there any possible problem with the NDK or my CMake?

I haven’t seen your files, I wouldn’t know. I use SQLite in all of my games

or can you share an example of a cocos2dx v4 project with cmake that uses sqlite encryption?

I’m sorry I’m presumptuous, but I really need it

This isn’t related to cocos2d-x at all though. We don’t own SQLite nor did we create the content you are following. Why not ask in the repo you mentioned.