java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String ti.modules.titanium.database.TiDatabaseProxy.getName()' on a null object reference

Appcelerator JIRA | Ryan Gartin | 11 months ago
  1. 0

    In iOS I can open (or create if doesn't exist) a database in the applicationDataDirectory and it works fine: {code:java} db = Ti.Database.open(Ti.Filesystem.applicationDataDirectory+filename); {code} However in Android I get errors. It doesn't seem like it will even try to create a database. {code:java} var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,"1554006938"); db = Ti.Database.open(file); error log: [DEBUG] : TiDatabase: (KrollRuntimeThread) [12816,20327] Opening database from filesystem: /data/data/com.abc.abc/app_appdata/1554006938 [ERROR] : SQLiteLog: (14) cannot open file at line 32470 of [9491ba7d73] [ERROR] : SQLiteLog: (14) os_unix.c:32470: (2) open(/data/data/com.abc.abc/app_appdata/1554006938) - [ERROR] : SQLiteDatabase: Failed to open database '/data/data/com.abc.abc/app_appdata/1554006938'. [ERROR] : SQLiteDatabase: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:318) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:228) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:512) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:178) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:891) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:861) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:696) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:671) [ERROR] : SQLiteDatabase: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:66) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [ERROR] : SQLiteDatabase: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [ERROR] : SQLiteDatabase: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : SQLiteDatabase: at android.os.Looper.loop(Looper.java:145) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [WARN] : W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String ti.modules.titanium.database.TiDatabaseProxy.getName()' on a null object reference [WARN] : W/System.err: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:77) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:145) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : Error opening DB: {} {code} also tried this: {code:java} db = Ti.Database.open(Ti.Filesystem.applicationDataDirectory+"-1501149833"); error log: [WARN] : W/System.err: java.lang.IllegalArgumentException: File appdata-private://-1501149833 contains a path separator [WARN] : W/System.err: at android.app.ContextImpl.makeFilename(ContextImpl.java:2853) [WARN] : W/System.err: at android.app.ContextImpl.validateFilePath(ContextImpl.java:2837) [WARN] : W/System.err: at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1503) [WARN] : W/System.err: at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1497) [WARN] : W/System.err: at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:276) [WARN] : W/System.err: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:70) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:145) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : Error opening DB: {} {code} Neither work for Android

    Appcelerator JIRA | 11 months ago | Ryan Gartin
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String ti.modules.titanium.database.TiDatabaseProxy.getName()' on a null object reference
  2. 0

    In iOS I can open (or create if doesn't exist) a database in the applicationDataDirectory and it works fine: {code:java} db = Ti.Database.open(Ti.Filesystem.applicationDataDirectory+filename); {code} However in Android I get errors. It doesn't seem like it will even try to create a database. {code:java} var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,"1554006938"); db = Ti.Database.open(file); error log: [DEBUG] : TiDatabase: (KrollRuntimeThread) [12816,20327] Opening database from filesystem: /data/data/com.abc.abc/app_appdata/1554006938 [ERROR] : SQLiteLog: (14) cannot open file at line 32470 of [9491ba7d73] [ERROR] : SQLiteLog: (14) os_unix.c:32470: (2) open(/data/data/com.abc.abc/app_appdata/1554006938) - [ERROR] : SQLiteDatabase: Failed to open database '/data/data/com.abc.abc/app_appdata/1554006938'. [ERROR] : SQLiteDatabase: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:318) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:228) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:512) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:178) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:891) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:861) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:696) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:671) [ERROR] : SQLiteDatabase: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:66) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [ERROR] : SQLiteDatabase: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [ERROR] : SQLiteDatabase: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : SQLiteDatabase: at android.os.Looper.loop(Looper.java:145) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [WARN] : W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String ti.modules.titanium.database.TiDatabaseProxy.getName()' on a null object reference [WARN] : W/System.err: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:77) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:145) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : Error opening DB: {} {code} also tried this: {code:java} db = Ti.Database.open(Ti.Filesystem.applicationDataDirectory+"-1501149833"); error log: [WARN] : W/System.err: java.lang.IllegalArgumentException: File appdata-private://-1501149833 contains a path separator [WARN] : W/System.err: at android.app.ContextImpl.makeFilename(ContextImpl.java:2853) [WARN] : W/System.err: at android.app.ContextImpl.validateFilePath(ContextImpl.java:2837) [WARN] : W/System.err: at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1503) [WARN] : W/System.err: at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1497) [WARN] : W/System.err: at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:276) [WARN] : W/System.err: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:70) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:145) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : Error opening DB: {} {code} Neither work for Android I have created a PR and Fix for this here: https://github.com/appcelerator/titanium_mobile/pull/7607

    Appcelerator JIRA | 11 months ago | Ryan Gartin
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String ti.modules.titanium.database.TiDatabaseProxy.getName()' on a null object reference
  3. 0

    In iOS I can open (or create if doesn't exist) a database in the applicationDataDirectory and it works fine: {code:java} db = Ti.Database.open(Ti.Filesystem.applicationDataDirectory+filename); {code} However in Android I get errors. It doesn't seem like it will even try to create a database. {code:java} var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,"1554006938"); db = Ti.Database.open(file); error log: [DEBUG] : TiDatabase: (KrollRuntimeThread) [12816,20327] Opening database from filesystem: /data/data/com.abc.abc/app_appdata/1554006938 [ERROR] : SQLiteLog: (14) cannot open file at line 32470 of [9491ba7d73] [ERROR] : SQLiteLog: (14) os_unix.c:32470: (2) open(/data/data/com.abc.abc/app_appdata/1554006938) - [ERROR] : SQLiteDatabase: Failed to open database '/data/data/com.abc.abc/app_appdata/1554006938'. [ERROR] : SQLiteDatabase: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:318) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:228) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:512) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:178) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:891) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:861) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:696) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:671) [ERROR] : SQLiteDatabase: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:66) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [ERROR] : SQLiteDatabase: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [ERROR] : SQLiteDatabase: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : SQLiteDatabase: at android.os.Looper.loop(Looper.java:145) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [WARN] : W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String ti.modules.titanium.database.TiDatabaseProxy.getName()' on a null object reference [WARN] : W/System.err: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:77) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:145) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : Error opening DB: {} {code} also tried this: {code:java} db = Ti.Database.open(Ti.Filesystem.applicationDataDirectory+"-1501149833"); error log: [WARN] : W/System.err: java.lang.IllegalArgumentException: File appdata-private://-1501149833 contains a path separator [WARN] : W/System.err: at android.app.ContextImpl.makeFilename(ContextImpl.java:2853) [WARN] : W/System.err: at android.app.ContextImpl.validateFilePath(ContextImpl.java:2837) [WARN] : W/System.err: at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1503) [WARN] : W/System.err: at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1497) [WARN] : W/System.err: at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:276) [WARN] : W/System.err: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:70) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:145) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : Error opening DB: {} {code} Neither work for Android

    Appcelerator JIRA | 11 months ago | Ryan Gartin
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String ti.modules.titanium.database.TiDatabaseProxy.getName()' on a null object reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    In iOS I can open (or create if doesn't exist) a database in the applicationDataDirectory and it works fine: {code:java} db = Ti.Database.open(Ti.Filesystem.applicationDataDirectory+filename); {code} However in Android I get errors. It doesn't seem like it will even try to create a database. {code:java} var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,"1554006938"); db = Ti.Database.open(file); error log: [DEBUG] : TiDatabase: (KrollRuntimeThread) [12816,20327] Opening database from filesystem: /data/data/com.abc.abc/app_appdata/1554006938 [ERROR] : SQLiteLog: (14) cannot open file at line 32470 of [9491ba7d73] [ERROR] : SQLiteLog: (14) os_unix.c:32470: (2) open(/data/data/com.abc.abc/app_appdata/1554006938) - [ERROR] : SQLiteDatabase: Failed to open database '/data/data/com.abc.abc/app_appdata/1554006938'. [ERROR] : SQLiteDatabase: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:318) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:228) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:512) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:178) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:891) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:861) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:696) [ERROR] : SQLiteDatabase: at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:671) [ERROR] : SQLiteDatabase: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:66) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [ERROR] : SQLiteDatabase: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [ERROR] : SQLiteDatabase: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : SQLiteDatabase: at android.os.Looper.loop(Looper.java:145) [ERROR] : SQLiteDatabase: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [WARN] : W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String ti.modules.titanium.database.TiDatabaseProxy.getName()' on a null object reference [WARN] : W/System.err: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:77) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:145) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : Error opening DB: {} {code} also tried this: {code:java} db = Ti.Database.open(Ti.Filesystem.applicationDataDirectory+"-1501149833"); error log: [WARN] : W/System.err: java.lang.IllegalArgumentException: File appdata-private://-1501149833 contains a path separator [WARN] : W/System.err: at android.app.ContextImpl.makeFilename(ContextImpl.java:2853) [WARN] : W/System.err: at android.app.ContextImpl.validateFilePath(ContextImpl.java:2837) [WARN] : W/System.err: at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1503) [WARN] : W/System.err: at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:1497) [WARN] : W/System.err: at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:276) [WARN] : W/System.err: at ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:70) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131) [WARN] : W/System.err: at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:145) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : Error opening DB: {} {code} Neither work for Android I have created a PR and Fix for this here: https://github.com/appcelerator/titanium_mobile/pull/7607

    Appcelerator JIRA | 11 months ago | Ryan Gartin
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String ti.modules.titanium.database.TiDatabaseProxy.getName()' on a null object reference
  6. 0

    NPE and InvocationTargetException error

    Stack Overflow | 2 years ago | user2883071
    java.lang.IllegalStateException: Could not execute method of the activity

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'java.lang.String ti.modules.titanium.database.TiDatabaseProxy.getName()' on a null object reference

      at ti.modules.titanium.database.DatabaseModule.open()
    2. ti.modules.titanium
      DatabaseModule.open
      1. ti.modules.titanium.database.DatabaseModule.open(DatabaseModule.java:77)
      1 frame
    3. org.appcelerator.kroll
      KrollProxy.handleMessage
      1. org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
      2. org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
      3. org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:908)
      4. org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1131)
      4 frames
    4. org.appcelerator.titanium
      TiViewProxy.handleMessage
      1. org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:352)
      1 frame
    5. Android Platform
      Looper.loop
      1. android.os.Handler.dispatchMessage(Handler.java:98)
      2. android.os.Looper.loop(Looper.java:145)
      2 frames
    6. org.appcelerator.kroll
      KrollRuntime$KrollRuntimeThread.run
      1. org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
      1 frame