Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phonegap Build echoTest Issue #466

Closed
michaelhanson opened this issue Apr 18, 2016 · 16 comments
Closed

Phonegap Build echoTest Issue #466

michaelhanson opened this issue Apr 18, 2016 · 16 comments

Comments

@michaelhanson
Copy link

michaelhanson commented Apr 18, 2016

Hi,

I am struggling to get this plugin working with Phonegap Build. It is likely that I am making a silly mistake but I cannot figure out why I can't get the plugin to work as it seems fairly straight forward from the documentation provided.

When I build the code using the phonegap remote run android command, the code builds with no issues as far as I am aware. On the Phonegap Build website it says it has added the plugin as well. However neither of the alerts appear in the echoTest function call as shown below.

config.xml
<plugin name="cordova-sqlite-storage" source="npm"/>

index.html

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="SQLitePlugin.js"></script>

<script type="text/javascript">
    document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() {
        window.sqlitePlugin.echoTest(
            function(success) {
                alert('SQLite SUCCESS: ' + JSON.stringify(success));
            },
            function(error) {
                alert('SQLite ERROR: ' + JSON.stringify(error));
            }
        );
    }
</script>

Any help provided would be much appreciated.

@brodycj
Copy link
Contributor

brodycj commented Apr 18, 2016

I am not sure how much I can help you since I do not use PhoneGap Build
anymore.

Were you able to get any other plugins such as cordova-plugin-dialogs
working with PhoneGap Build?

Also there is no need to include SQLitePlugin.js in index.html. Cordova
includes it automatically assuming you include cordova.js.
On Apr 18, 2016 1:25 PM, "michaelhanson" [email protected] wrote:

Hi,

I am struggling to get this plugin working with Phonegap Build. It is
likely that I am making a silly mistake but I cannot figure out why I can't
get the plugin to work as it seems fairly straight forward from the
documentation provided.

When I build the code using the phonegap remote run android command,
the code builds with no issues as far as I am aware. On the Phonegap Build
website it says it has added the plugin as well. However neither of the
alerts appear in the echoTest function call as shown below.

config.xml

index.html
`

`

Any help provided would be much appreciated.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#466

@michaelhanson
Copy link
Author

Thanks for the reply.

I have got the cordova-plugin-statusbar and a barcode scanner plugin working without any major issues. I have tried all the variations of the SQLite plugin found on the phonegap build plugin website without any success.

I understand that this is an issue with the way I am building the code through Phonegap Build. I find it a bit odd that none of the SQLite plugins are keeping up to date with the latest versions of the Phonegap CLI. Is there any particular reason for this?

@brodycj
Copy link
Contributor

brodycj commented Apr 18, 2016

I find this really strange. I don't know if you are talking about some old sqlite plugin versions that were published to PhoneGap build in 2014/2015 or if you tried the newer versions that I am maintaining.

You said that you are able to build using the PhoneGap CLI. Are you able to get the echoTest and perhaps some other simple functionality working in a PhoneGap CLI project?

In general I constantly test my work using the Cordova CLI. I wonder if I should test my work using the PhoneGap CLI as well.

In addition, I do not support the engines, other libraries, or tooling from Cordova releases older than 6.0.0. PhoneGap CLI seems to have incorporated Cordova 6.0.0 so this should not be an issue assuming that the PhoneGap Build is also up-to-date.

Perhaps you should file a question or issue with the PhoneGap Build system in case they can help you with this issue.

@michaelhanson
Copy link
Author

Thanks again for the prompt reply. Maybe I am getting my wires crossed here. I am currently new to the Phonegap technology as a Developer so bear with me. You're probably correct about this issue being more of a Phonegap Build question rather than here.

I have created an app through Phonegap CLI 6.0.0 which as you know has some built in plugins included with it. I have then been using the 3rd party Phonegap Build / Cordova plugins for the status bar and bar code scanner plugins which work fine.

I also have a Phonegap Build account where I send my code to be built using the phonegap remote build or run commands provided by Phonegap CLI. The Phonegap CLI allows you to add external plugins from git repositories or npm via the config file. This is what I did for this plugin and it pulls it in fine.

However when I implement the code mentioned above just to do a simple echoTest nothing happens, even with your suggested change of removing the SQLitePlugin.js reference.

I am open to any suggestions to try to resolve this issue. I figured because I followed the same process for the other 3rd party plugins this would work for this plugin also.

@michaelhanson
Copy link
Author

I have reverted back to the 0.8.5 version and the echoTest seems to be working. Will do some further testing with the other commands and report back.

@michaelhanson
Copy link
Author

michaelhanson commented Apr 18, 2016

Just following up from my last comment. The 0.8.5 version of the plugin code seems to work fine with the set-up I have got. I have run commands such as openDatabase and then transactions with create table and insert commands.

@brodycj
Copy link
Contributor

brodycj commented Apr 18, 2016

This is really strange. I published a 1.2.0 release less than 2 weeks ago and published a 1.2.1 release early this morning with minimal changes and no changes to the native Android or iOS code.

I am thinking about adding Windows support to this version and may make a lightweight branch for those who need it. If I do this I can make the branch based on 0.8.5 and hope it continues to work with PhoneGap Build.

@michaelhanson
Copy link
Author

I will do some further testing and try it on the latest versions again, see if I can find out exactly what the error is when building the code. It does seem a bit of an odd one though, also it may still be me doing a silly mistake that I haven't spotted yet. Will keep you posted with my progress.

@brodycj
Copy link
Contributor

brodycj commented Apr 18, 2016

Thanks. The last three versions are: 0.8.5, 1.2.0, and 1.2.1. 1.2.0 had some JavaScript and test changes, and 1.2.1 has some changes to enforce the minimum Cordova version (and a few new tests).

@Tawsif
Copy link

Tawsif commented Apr 21, 2016

same problem from me as well +1

@brodycj
Copy link
Contributor

brodycj commented Apr 21, 2016

Guys this is not enough information.

@michaelhanson reported that version 0.8.5 works OK so I suspect that something in the 1.2.0 or 1.2.1 version trips up PhoneGap Build. @michaelhanson do you have any more results?

I need to know specifically whether the problem starts with 1.2.0, 1.2.1, or if there is something else going on.

Considering that I test this plugin extensively with the Cordova CLI, I suspect there is something going on with PhoneGap Build or the PhoneGap tooling.

@brodycj
Copy link
Contributor

brodycj commented Apr 21, 2016

Also someone else reported problems with PhoneGap 6.0.1 in #467.

@brodycj
Copy link
Contributor

brodycj commented Apr 25, 2016

PhoneGap build and PhoneGap CLI (#467) will no longer be supported due to reported issues. This plugin is only tested and supported with Cordova CLI. Support for plugman is also dropped.

@michaelhanson
Copy link
Author

Sorry for the late reply. Not been at work for a few days.

After doing some further testing I couldn't get the plugin to work on 1.2.0 or 1.2.1. It is still working on 0.8.5.

However now you have stated you aren't supporting Phonegap Build or CLI any more then there isn't much more in pursuing this issue.

May I ask why you aren't supporting Phonegap anymore?

@brodycj
Copy link
Contributor

brodycj commented May 4, 2016

Sorry for the delay on my side. I am considering whether or not to support PhoneGap CLI and PhoneGap Build tooling in the future.

FYI a problem with the PhoneGap CLI version was reported in #467.

Again I find this really strange. PhoneGap is based on Cordova and if a plugin works in Cordova it should work with PhoneGap CLI and PhoneGap Build. There was a weird issue with PhoneGap Build in the past where it would not build the iOS version if the name did not start with an uppercase letter (phonegap/build#431 #243).

To support PhoneGap Build would take both time and some money for the monthly subscription fee. I would be happy to do this if anyone would be interested in paying me for this service. If you or anyone else is interested you may contact me at [email protected] or [email protected].

@brodycj
Copy link
Contributor

brodycj commented May 11, 2016

Closing in favor of discussion in #477 (PhoneGap Build issues in 1.4.0/+)

@brodycj brodycj closed this as completed May 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants