"cordova-sqlite-evcore-extbuild-free"

Question.

With the new config that includes:

 <plugin name = "cordova-plugin-wkwebview-engine" source = "npm" />
 <platform name = "ios">
   <preference name = "WKWebViewOnly" value = "true" />
   <feature name = "CDVWKWebViewEngine">
     <param name = "ios-package" value = "CDVWKWebViewEngine" />
   </feature>
   <preference name = "CordovaWebViewEngine" value = "CDVWKWebViewEngine" />
 </platform>

the instruction I include in the Config and I show below does not work:

 <plugin name = "cordova-sqlite-evcore-extbuild-free" source = "npm" />

so when running the application natively in IOS it is noticed:

“SQLite not supported”

Do you know if that currently has a solution?

Regards,
Victor Hidalgo

The instruction I refer to is the one that considers “… WKWebViewOnly”, etc.

Sorry I didn’t enter it completely, but it’s the one from the last config. and the version runs natively using AppStudio + VoltBuilder.

Does declaring cordova-plugin-wkwebview-engine after setting the preferences make any difference?

<platform name = "ios">
   <preference name = "WKWebViewOnly" value = "true" />
   <feature name = "CDVWKWebViewEngine">
     <param name = "ios-package" value = "CDVWKWebViewEngine" />
   </feature>
   <preference name = "CordovaWebViewEngine" value = "CDVWKWebViewEngine" />
</platform>
<plugin name = "cordova-plugin-wkwebview-engine" source = "npm" />

I have indicated it by testing at the beginning, in the middle and at the end and in all cases I indicate the same … “SQLite not supported”, however if not included it works fine.

Here’s what I have and what’s working for me…

  <plugin name="cordova-plugin-wkwebview-engine" spec="1.2.1" />
  <plugin name="cordova-plugin-wkwebview-file-xhr" spec="2.1.4" />
  .
  .
  .
  <plugin name="cordova-sqlite-storage" spec="5.0.0" />

Thanks for the feedback.

I have tried it and it doesn’t work.

I ask: Would it be possible for you to provide me with an example of yours, in which sqlite is used, and it will work to see if I replicate it?

Thank you in advance for your support.

Able can tell me if the Config I have is putting it wrong.
I pass it in case it helps …

<? xml version = "1.0" encoding = "UTF-8"?>
<widget
xmlns = "https://www.w3.org/ns/widgets"
xmlns: gap = "http://phonegap.com/ns/1.0"
id = "com.nsbasic. {id}"
android-versionCode = "{phoneGapBuildCounter}"
ios-CFBundleVersion = "{phoneGapBuildCounter}"
version = "{version}">

<name> {title} </name>
<description> {description} </description>
<preference name = "phonegap-version" value = "{phoneGapVersion}" />

<icon src = '{icon}' />
<preference name = 'SplashScreenDelay' value = '2000' />
<preference name = 'AutoHideSplashScreen' value = 'true' />
<plugin name = 'cordova-plugin-splashscreen' source = 'npm' />

<preference name = "permissions" value = "none" />
<! - sample preference specifications ->
<! - <preference name = "autorotate" value = "false" readonly = "true" /> ->
<! - <preference name = "orientation" value = "default" /> ->
<! - <preference name = "fullscreen" value = "true" /> ->

<! - Platforms: Customize as needed. ->
<gap: platforms>
   <gap: platform name = "android" />
   <gap: platform name = "ios" />
</ gap: platforms>

<plugin name = "cordova-plugin-statusbar" source = "npm" />
  <preference name = "StatusBarOverlaysWebView" value = "{phoneGapStatusBarOverlay}" />
  <preference name = "StatusBarBackgroundColor" value = "{phoneGapStatusBarColor}" />
  <preference name = "StatusBarStyle" value = "{phoneGapStatusBarStyle}" />
  
  <plugin name = "cordova-plugin-wkwebview-engine" spec = "1.2.1" />
  <plugin name = "cordova-plugin-wkwebview-file-xhr" spec = "2.1.4" />
  <plugin name = "cordova-sqlite-storage" spec = "5.0.0" />
  
  <plugin name = "cordova-plugin-whitelist" source = "npm" />
  <allow-navigation href = "*" />
  <access origin = "*" />
  <allow-intent href = "*" />
  
</widget>

Thank you again.

I had to sterilize it a bit but this works for opening the db and creating the table.

// this function would open the database, create the table (if needed)
function init_db(callback)
{
  let params = null;

  // if we already have a handle we can skip this
  if(myDB != null)
	  return;

  switch(device.platform)
  {
    case "ios":    
    case "iOS": 
      params = {name: 'myAppDB', iosDatabaseLocation: 'default'};
      break;

    case "android":
    case "Android":
      params = {name: 'myAppDB', location: 'default'};
      break;
  }
  
  myDB = window.sqlitePlugin.openDatabase(params, function() {
      // console.log("creating the table after db open");
      sqlCreateTable(function() {
          if(typeof callback === "function")
          {
             callback();
          }              
      });  
  }, function() {
      popupDialog("<strong>Oh No!</strong><br>1029: Error Creating database.", {
        'type':     'Error',
        'title':    'Serious Device Problems'                     
      });
      exit(-1);  
  });
}

function sqlCreateTable(callback)
{
  var db = myDB;

  // msg_id, channel, type, title, text, when, contact
  db.transaction(function(tx) {
    tx.executeSql("CREATE TABLE IF NOT EXISTS mytable (msg_id UNSIGNED BIG INT PRIMARY KEY ASC, channel INTEGER, type INTEGER, msg_when TEXT, msg_read INTEGER, title TEXT, msg_text TEXT)", 
    		      [], sqlNullHandler, sqlOnError);
    tx.executeSql("CREATE UNIQUE INDEX IF NOT EXISTS unique_id ON mytable (msg_id)", 
              [],
              function() {
                if(typeof callback === "function")
                   callback();              
              },
              sqlOnError);
  });
}

Thanks, I’ll try.

It is a little different than what I have worked on but I will try.

Greetings,

Now that you’re off phonegap you can remove all of that “gap:” stuff as that is just for them.

Here’s a generic config I start projects with:

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" 
        xmlns:gap="http://phonegap.com/ns/1.0" 
        xmlns:cdv="http://cordova.apache.org/ns/1.0" 
        xmlns:android="http://schemas.android.com/apk/res/android" 
        android-versionCode="1" 
        ios-CFBundleVersion="1" 
        version="0.0.1" id="com.myapp.android">
  <name>My App</name>
  <description>My App</description>
  <author href="http://www.blank.com" email="my.email@gmail.com">Blank.com</author>
  <content src="index.html"></content>
  <preference name="android-build-tool" value="gradle" />
  <preference name="xwalkMultipleApk" value="false" />
  <preference name="DisallowOverscroll" value="true" />
  <preference name="WebviewBounce" value="false" />
  <preference name="EnableViewPortScale" value="true" />
  <!-- below requires the splash screen plugin -->
  <!-- docs: https://github.com/apache/cordova-plugin-splashscreen -->
  <preference name="SplashMaintainAspectRatio" value="false" />
  <preference name="AutoHideSplashScreen" value="true" />
  <preference name="FadeSplashScreen" value="false" />
  <preference name="FadeSplashScreenDuration" value="2" />
  <preference name="ShowSplashScreenSpinner" value="false" />
  <platform name="ios">
    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarBackgroundColor" value="#000000" />
    <preference name="StatusBarStyle" value="lightcontent" />
    <preference name="exit-on-suspend" value="false" />
    <preference name="deployment-target" value="9.0" />
    <preference name="ios-configuration" value="adhoc" />
    <preference name="Fullscreen" value="false" />
    <preference name="Orientation" value="all" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
    <access origin="*" />
    <icon platform="ios" src="package-assets/Icon-App-29x29@1x.png" width="29" height="29" />
    <icon platform="ios" src="package-assets/Icon-App-29x29@2x.png" width="58" height="58" />
    <icon platform="ios" src="package-assets/Icon-App-29x29@3x.png" width="87" height="87" />
    <icon platform="ios" src="package-assets/Icon-App-60x60@1x.png" width="60" height="60" />
    <icon platform="ios" src="package-assets/Icon-App-60x60@2x.png" width="120" height="120" />
    <icon platform="ios" src="package-assets/Icon-App-60x60@3x.png" width="180" height="180" />
    <icon platform="ios" src="package-assets/Icon-App-76x76@1x.png" width="76" height="76" />
    <icon platform="ios" src="package-assets/Icon-App-76x76@2x.png" width="152" height="152" />
    <icon platform="ios" src="package-assets/Icon-App-40x40@1x.png" width="40" height="40" />
    <icon platform="ios" src="package-assets/Icon-App-40x40@2x.png" width="80" height="80" />
    <icon platform="ios" src="package-assets/Icon-App-57x57@1x.png" width="57" height="57" />
    <icon platform="ios" src="package-assets/Icon-App-57x57@2x.png" width="114" height="114" />
    <icon platform="ios" src="package-assets/Icon-App-72x72@1x.png" width="72" height="72" />
    <icon platform="ios" src="package-assets/Icon-App-72x72@2x.png" width="144" height="144" />
    <icon platform="ios" src="package-assets/Icon-Small-50x50@1x.png" width="50" height="50" />
    <icon platform="ios" src="package-assets/Icon-Small-50x50@2x.png" width="100" height="100" />
    <icon platform="ios" src="package-assets/Icon-App-83.5x83.5@2x.png" width="167" height="167" />
    <splash platform="ios" src="package-assets/splash_320x480.png" width="320" height="480" orientation="portrait" />
    <splash platform="ios" src="package-assets/splash_640x960.png" width="640" height="960" orientation="portrait" />
    <splash platform="ios" src="package-assets/splash_640x1136.png" orientation="portrait" height="1136" width="640" />
    <splash platform="ios" src="package-assets/splash_768x1024.png" orientation="portrait" height="1024" width="768" />
    <splash platform="ios" src="package-assets/splash_1536x2048.png" orientation="portrait" height="2048" width="1536" />
    <splash platform="ios" src="package-assets/splash_2048x2732.png" orientation="portrait" height="2732" width="2048" />
    <splash platform="ios" src="package-assets/splash_1242x2208.png" orientation="portrait" height="2208" width="1242" />
    <splash platform="ios" src="package-assets/splash_750x1334.png" orientation="portrait" height="1334" width="750" />
    <splash platform="ios" src="package-assets/splash_1024x768.png" orientation="landscape" height="768" width="1024" />
    <splash platform="ios" src="package-assets/splash_2048x1536.png" orientation="landscape" height="1536" width="2048" />
    <splash platform="ios" src="package-assets/splash_2208x1242.png" orientation="landscape" height="1242" width="2208" />
    <splash platform="ios" src="package-assets/splash_1334x750.png" orientation="landscape" height="750" width="1334" />
    <splash platform="ios" src="package-assets/splash_2732x2048.png" orientation="landscape" height="2048" width="2732" />
  </platform>
  <platform name="android">
    <preference name="android-minSdkVersion" value="19" />
    <preference name="android-targetSdkVersion" value="28" />
    <preference name="android-installLocation" value="auto" />
    <preference name="android-multiDexEnabled" value="true" />
    <preference name="Fullscreen" value="false" />
    <preference name="Orientation" value="portrait" />
    <preference name="android-signed" value="true" />
    <preference name="AndroidLaunchMode" value="singleTop" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-intent href="market:*" />
    <access origin="*" />
    <icon platform="android" src="package-assets/ic_ldpi.png" density="ldpi" width="36" height="36" />
    <icon platform="android" src="package-assets/ic_mdpi.png" density="mdpi" width="48" height="48" />
    <icon platform="android" src="package-assets/ic_hdpi.png" density="hdpi" width="72" height="72" />
    <icon platform="android" src="package-assets/ic_xhdpi.png" density="xhdpi" width="96" height="96" />
    <splash platform="android" src="package-assets/splash_320x426.png" density="ldpi" width="320" height="426" orientation="portrait" />
    <splash platform="android" src="package-assets/splash_320x470.png" density="mdpi" width="320" height="470" orientation="portrait" />
    <splash platform="android" src="package-assets/splash_480x640.png" density="hdpi" width="480" height="640" orientation="portrait" />
    <splash platform="android" src="package-assets/splash_720x960.png" density="xhdpi" width="720" height="960" orientation="portrait" />
    <splash platform="android" src="package-assets/splash_426x320.png" orientation="landscape" height="320" width="426" density="ldpi" />
    <splash platform="android" src="package-assets/splash_470x320.png" orientation="landscape" height="320" width="470" density="mdpi" />
    <splash platform="android" src="package-assets/splash_640x480.png" orientation="landscape" height="480" width="640" density="hdpi" />
    <splash platform="android" src="package-assets/splash_960x720.png" orientation="landscape" height="720" width="960" density="xhdpi" />
  </platform> 
  <plugin name="cordova-plugin-splashscreen" spec="5.0.3" />
  <plugin name="cordova-plugin-statusbar" spec="2.4.3" />
  <plugin name="cordova-plugin-whitelist" spec="1.3.4" />
  <plugin name="cordova-plugin-device" spec="2.0.3" />
  <plugin name="cordova-plugin-compat" spec="1.2.0" />
  <plugin name="cordova.plugins.diagnostic" spec="3.7.2" />
  <plugin name="cordova-plugin-network-information" spec="2.0.2" />
  <plugin name="cordova-open-native-settings" spec="1.5.2" />
  <plugin name="cordova-plugin-email-composer" source="npm" spec="0.9.2" />
  <plugin name="cordova-plugin-x-socialsharing" spec="5.6.2" />
  <!--
  <plugin name="cordova-plugin-contacts" spec="3.0.1">
    <variable name="CONTACTS_USAGE_DESCRIPTION" value="We do not collect or store information on any of your contacts." />
  </plugin>
  <plugin name="es6-promise-plugin" spec="4.2.2" />
  -->
</widget>

Yeah, it’s not a one to one port from websql to the plugin but once you get past this first part, most of your tx queries will work as is.

Thanks again for the support.

I’m going to try first what you sent me from the Config, Excellent.
The programming that you sent me earlier I see it a little more complicated, so I hope it works with the Config (I usually work in Basic, but I will test it if necessary).

Thank you.

Are you attempting to initialize your database before the deviceready event has fired? If so, the sqlite plugin will not be initialized and you will get the ‘SQLite not supported’ error.

In my projects, I was initializing the database in the Main() function which fired before the deviceready event so I was getting that same error. I had to re-write to delay the database initialization until after deviceready and now it works fine.

If your project needs to run both on a device and in a browser, then you actually have to detect whether you’re running on a device or not since the deviceready event won’t fire when running in the browser.

Hope that helps.

Nate

Thanks, I’ll try it.

As you say, I start it from the Main (). I will taste the change.

For now, I’m making changes to the Config in steps and until now I get the same result.

regards,

Dear Sirs,

I tell you that I have tried what I have been told in the Config and the opportunity in which the database is created in sql and unfortunately it has not worked for me.

I have tried, creating a smaller program what PPetre told me and it did not go very well. So I cannot comment much in that case and because of my ignorance of that method.

What I can say is that removing:
“cordova-plugin-wkwebview-engine”
there, if it works but Apple does not allow the app to upload.

If you ever have the solution please post it in full.

Thanks for your support.

Regards.

Did you try @Nate’s suggestion? It’s a good one.

If right. I tried too but the same result left me.

Post your sample project files.

I was just leaving the SQL thing to facilitate the information.

[https://discuss.appstudio.dev/user_avatar/discuss.appstudio.dev/ppetree/45/580_2.png] PPetreehttps://discuss.appstudio.dev/u/ppetree
July 8

Post your sample project files.

MuestraParaSql.appstudio.zip (78.9 KB)