Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Christopher J. Brody
    @brodybits
    Best if you can raise this as an issue
    rickarddahlinfor
    @rickarddahlinfor

    Hi again! I have now made some more testing, and I got ”PRAGMA AUTO_VACUUM = 1;” to work by executing ”VACUUM;” directly after the auto_vacuum statement is executed. This is (?) a bug and I will file an issue on it.

    I using an iOS 8.4 simulator. The open parameters are "window.sqlitePlugin.openDatabase({name: db_name, location: 2, createFromLocation: 1});”.

    Christopher J. Brody
    @brodybits
    Thanks for letting me know. This may be because of how sqlite3.c is built. I will document this in the readme when I get a chance.
    greatredpie
    @greatredpie
    Hi. Sorry bit of a phone gap noob. When building this app with build.phonegap.com can I just add this plugin to the config.xml file, rather than installing the plugin using the CLI. As shown here: http://docs.build.phonegap.com/en_US/configuring_plugins.md.html#Plugins
    Christopher J. Brody
    @brodybits
    Yes that should work. If not you can file an issue.
    lyric123123
    @lyric123123
    blob
    This is my file source tree.
    08-27 11:31:20.065: W/dalvikvm(5138): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lio/liteglue/SQLitePlugin;
    08-27 11:31:20.185: W/System.err(5138): java.lang.ClassNotFoundException: io.liteglue.SQLitePlugin
    08-27 11:31:20.185: W/System.err(5138): at java.lang.Class.classForName(Native Method)
    08-27 11:31:20.195: W/System.err(5138): at java.lang.Class.forName(Class.java:251)
    08-27 11:31:20.195: W/System.err(5138): at java.lang.Class.forName(Class.java:216)
    08-27 11:31:20.195: W/System.err(5138): at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:403)
    08-27 11:31:20.195: W/System.err(5138): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:193)
    08-27 11:31:20.195: W/System.err(5138): at org.apache.cordova.PluginManager.exec(PluginManager.java:141)
    08-27 11:31:20.195: W/System.err(5138): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:63)
    08-27 11:31:20.195: W/System.err(5138): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:40)
    08-27 11:31:20.295: W/System.err(5138): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
    08-27 11:31:20.295: W/System.err(5138): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
    08-27 11:31:20.305: W/System.err(5138): at android.os.Handler.dispatchMessage(Handler.java:102)
    08-27 11:31:20.305: W/System.err(5138): at android.os.Looper.loop(Looper.java:136)
    08-27 11:31:20.305: W/System.err(5138): at android.os.HandlerThread.run(HandlerThread.java:61)
    08-27 11:31:20.315: W/System.err(5138): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load sqlc-native-driver from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.ionicframework.testplugin2382207-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.ionicframework.testplugin2382207-1, /system/lib]]]: findLibrary returned null
    08-27 11:31:20.315: W/System.err(5138): at java.lang.Runtime.loadLibrary(Runtime.java:358)
    08-27 11:31:20.315: W/System.err(5138): at java.lang.System.loadLibrary(System.java:526)
    08-27 11:31:20.375: W/System.err(5138): at io.liteglue.SQLiteConnector.<init>(SQLiteConnector.java:8)
    08-27 11:31:20.375: W/System.err(5138): at io.liteglue.SQLitePlugin.<clinit>(SQLitePlugin.java:47)
    08-27 11:31:20.385: W/System.err(5138): ... 13 more
    08-27 11:31:20.385: I/System.out(5138): Error adding plugin io.liteglue.SQLitePlugin.
    08-27 11:31:20.385: W/System.err(5138): java.lang.NullPointerException
    08-27 11:31:20.415: W/System.err(5138): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:195)
    08-27 11:31:20.425: W/System.err(5138): at org.apache.cordova.PluginManager.exec(PluginManager.java:141)
    08-27 11:31:20.435: W/System.err(5138): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:63)
    08-27 11:31:20.435: W/System.err(5138): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:40)
    08-27 11:31:20.435: W/System.err(5138): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
    08-27 11:31:20.435: W/System.err(5138): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
    08-27 11:31:20.435: W/System.err(5138): at android.os.Handler.dispatchMessage(Handler.java:102)
    08-27 11:31:20.445: W/System.err(5138): at android.os.Looper.loop(Looper.java:136)
    08-27 11:31:20.445: W/System.err(5138): at android.os.HandlerThread.run(HandlerThread.java:61)
    08-27 11:31:21.615: I/Choreographer(5138): Skipped 54 frames! The application may be doing too much work on its main thread.
    08-27 11:31:22.405: I/Choreographer(5138): Skipped 47 frames! The application may be doing too much work on its main thread.
    Christopher J. Brody
    @brodybits
    SQLitePlugin.java should have been installed in src/io/liteglue
    lyric123123
    @lyric123123
    Caused by: java.lang.UnsatisfiedLinkError: Couldn't load sqlc-native-driver from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.ionicframework.testplugin2382207-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.ionicframework.testplugin2382207-1, /system/lib]]]: findLibrary returned null But, I have added the sqlite - native - driver. Jar file
    Christopher J. Brody
    @brodybits
    You may have to extract the contents of the lib subdirectory of sqlite-native-driver.jar into your libs directory, and remove sqlite-native-driver.jar from your project
    lyric123123
    @lyric123123
    blob
    How to extract the sqlite - native - driver lib subdirectory of the content.
    Christopher J. Brody
    @brodybits
    jar xf sqlite-native-driver.jar
    then do something like mv lib/* libs
    lyric123123
    @lyric123123
    Why can't directly use sqlite - native - driver. jar? I am a beginner, don't know the inside of the principle.
    Christopher J. Brody
    @brodybits
    It should be possible but certain Android implementations do not expect it
    Let me correct it. This is normal for regular Java, but Android is not regular Java. Android takes regular Java class files and converts them to DEX format before making the APK.
    lyric123123
    @lyric123123
    Excuse me, where is your ever using Cordova sqlite-storage small demo of success ,android.
    Christopher J. Brody
    @brodybits
    Hundreds, maybe thousands of apps already using it!
    lyric123123
    @lyric123123
    I know
    Christopher J. Brody
    @brodybits
    How do you create the app? Are you using the cordova cli or something else?
    If you are having trouble, it is best to start with an extremely simple test, such as what I put in README.md.
    lyric123123
    @lyric123123
    Ionic + cordova ,but this is an extremely simple test.
    Christopher J. Brody
    @brodybits
    Aah yes. Ionic, which I think you know is basically a version of Angular with the UI framework, can be a pain to use with Cordova. They have ngCordova.
    lyric123123
    @lyric123123
    Thanks
    lyric123123
    @lyric123123
    At the same mistake again.

    I downloaded the zip file from that site (the link is at the top right), then extracted the two files in the folder (src/android/libs) and placed them in the project's libs directory. Then, I refreshed the project.

    As the error kept going, he told me to "Make sure you removed sqlite-native-driver.jar". I deleted that file from the libs directory, refreshed the project, and The following error.

    08-27 11:31:20.065: W/dalvikvm(5138): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lio/liteglue/SQLitePlugin;
    08-27 11:31:20.185: W/System.err(5138): java.lang.ClassNotFoundException: io.liteglue.SQLitePlugin
    08-27 11:31:20.185: W/System.err(5138): at java.lang.Class.classForName(Native Method)
    08-27 11:31:20.195: W/System.err(5138): at java.lang.Class.forName(Class.java:251)
    08-27 11:31:20.195: W/System.err(5138): at java.lang.Class.forName(Class.java:216)
    08-27 11:31:20.195: W/System.err(5138): at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:403)
    08-27 11:31:20.195: W/System.err(5138): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:193)
    08-27 11:31:20.195: W/System.err(5138): at org.apache.cordova.PluginManager.exec(PluginManager.java:141)
    08-27 11:31:20.195: W/System.err(5138): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:63)
    08-27 11:31:20.195: W/System.err(5138): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:40)
    08-27 11:31:20.295: W/System.err(5138): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
    08-27 11:31:20.295: W/System.err(5138): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
    08-27 11:31:20.305: W/System.err(5138): at android.os.Handler.dispatchMessage(Handler.java:102)
    08-27 11:31:20.305: W/System.err(5138): at android.os.Looper.loop(Looper.java:136)
    08-27 11:31:20.305: W/System.err(5138): at android.os.HandlerThread.run(HandlerThread.java:61)
    08-27 11:31:20.315: W/System.err(5138): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load sqlc-native-driver from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.ionicframework.testplugin2382207-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.ionicframework.testplugin2382207-1, /system/lib]]]: findLibrary returned null
    08-27 11:31:20.315: W/System.err(5138): at java.lang.Runtime.loadLibrary(Runtime.java:358)
    08-27 11:31:20.315: W/System.err(5138): at java.lang.System.loadLibrary(System.java:526)
    08-27 11:31:20.375: W/System.err(5138): at io.liteglue.SQLiteConnector.<init>(SQLiteConnector.java:8)
    08-27 11:31:20.375: W/System.err(5138): at io.liteglue.SQLitePlugin.<clinit>(SQLitePlugin.java:47)
    08-27 11:31:20.385: W/System.err(5138): ... 13 more
    08-27 11:31:20.385: I/System.out(5138): Error adding plugin io.liteglue.SQLitePlugin.
    08-27 11:31:20.385: W/System.err(5138): java.lang.NullPointerException
    08-27 11:31:20.415: W/System.err(5138): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:195)
    08-27 11:31:20.425: W/System.err(5138): at org.apache.cordova.PluginManager.exec(PluginManager.java:141)
    08-27 11:31:20.435: W/System.err(5138): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:63)
    08-27 11:31:20.435: W/System.err(5138): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:40)
    08-27 11:31:20.435: W/System.err(5138): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
    08-27 11:31:20.435: W/System.err(5138): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
    08-27 11:31:20.435: W/System.err(5138): at android.os.Handler.dispatchMessage(Handler.java:102)
    08-27 11:31:20.445: W/System.err(5138): at android.os.Looper.loop(Looper.java:136)
    08-27 11:31:20.445: W/System.err(5138): at android.os.HandlerThread.run(HandlerThread.java:61)
    08-27 11:31:21.615: I/Choreographer(5138): Skipped 54 frames! The application may be doing too much work on its main thread.
    08-27 11:31:22.405: I/Choreographer(5138): Skipped 47 frames! The application may be doing too much work on its main thread.
    then
    blob
    lyric123123
    @lyric123123
    The same error, add the jar is not effective.
    Christopher J. Brody
    @brodybits
    You have to remove sqlite-native-driver.jar
    and make sure you install the native libraries in your libs directory instead
    lyric123123
    @lyric123123
    How to install the native libraries in my libs directory.
    Christopher J. Brody
    @brodybits
    You have to do jar xf sqlite-native-driver.jar to extract it.
    You will get a lib directory
    You have to move all the subdirectories from the lib directory into your libs directory
    I need to fix this very soon!
    lyric123123
    @lyric123123
    OK, thanks.
    shizhidi
    @shizhidi
    i want to know, where is the *.db file,I see no file on your mobile phone.
    Who knows?
    my phone
    Chun-Sheng, Li
    @peter279k
    Hi.If you use adt-bundle ,and you can open the DDMS.
    then open the file explorer and choose following path data/data/com.example.name.your-app-name/databases/your-db-name.db
    Christopher J. Brody
    @brodybits
    Thanks @peter279k. Yes for Android, external applications cannot see your database file unless you root your device (which I do not recommend). This should be documented, when I get a chance.
    Roman Chukhan
    @karatsuba
    Hi everyone! I am trying to make foreign key in table, but it does not work. Are you include such functionality in your plugin? Maybe you have some examples? Thanks.
    Christopher J. Brody
    @brodybits
    Roman Chukhan
    @karatsuba
    Thanks for link!
    Now I have next error: "FOREIGN KEY constraint failed", code "6"
    I am trying do it on iPad. Can you help me with it?
    Christopher J. Brody
    @brodybits