mribbons / cordova-plugin-cipherlab-rs30

Apache Cordova Barcode Scanner Plugin for Cipherlab RS30
MIT License
6 stars 12 forks source link

Crash during initialization #3

Closed manesware closed 8 years ago

manesware commented 8 years ago

Hello,

While I'm trying to run my app I keep getting "unfortunately [app_name] has stopped" message. It crashes while trying to execute the following line: function onDeviceReady() { cordova.plugins.CipherlabRS30CordovaPlugin.initialise(some_func); }

My environment:

Might be relevant: It use to work fine on another device with a slightly different build number. I also noticed that the ReaderConfig app Is also different.

Please advise, Thanks in advance, Meni

mribbons commented 8 years ago

Hi There, Please post the application output, it might provide a clue.

Also, do you have the RS30_ReaderSample app from CipherLab? I didn't look at the ReaderConfig app but if it has changed then it's likely that the other sample has changed too.

I have linked MainActivity.java from the ReaderSample I based the plugin off. You should compare the two to see what has changed.

manesware commented 8 years ago

Thank you for your response. I'll try to get hold on the logs and let you know.

Meni

web-slinger commented 8 years ago

@mribbons Hi, I've encountered the same issue

This is the first time me using this plugin so unaware if any previous versions were workable.

As soon as I call initialise() the app crashes.

App builder: cordova build Model number: CipherLab RS30 Android version: 4.4.2

If you need anymore details, please let me know I'm happy to help debug any issue :+1:

cipherlaberrorlog.txt

mribbons commented 8 years ago

Hi @web-slinger , Thanks for the info. I will review in further detail, but it looks like the plugin code isn't being reached (No debug output or related exceptions from the plugin).

Could you kindly post MainActivity.java from RS30_ReaderSample provided by Cipherlab?

Also exactly what version of phonegap are you using?

It would be great if you could post a sample app.

web-slinger commented 8 years ago

Hi @mribbons I used the Echo function just fine to check the plugin is functioning.

I believe I can get more info through a CatLog report but I can't save the recorded logs.

I'll have a look for this MainActivity.java later on.

Apologies I'm not using phonegap, I'm running this on Cordova android 4.1.1, with Cordova 5.1 CLI. I'll post an example app if that's needed.

mribbons commented 8 years ago

Hi @web-slinger, The full logcat output is essential.

Cordova 5.1 should be OK, also you say that Echo works so that's a good start.

web-slinger commented 8 years ago

@mribbons Here's a better logcat it shows the plugin initialises correctly but then fails on receiving the broadcast intent as some class not found errors.

cipherlaberrorlog3.txt

mribbons commented 8 years ago

Sorry but I can't see any ClassNotFound exceptions.

Also the output should contain a few lines starting with

V/CipherlabRS30Plugin

mribbons commented 8 years ago

Actually your issue does sound similar to this: https://github.com/mribbons/cordova-plugin-cipherlab-rs30/issues/1

I am not 100% sure how @eurosystem2000 resolved it,

But could you try changing plugins\cordova-plugin-cipherlab-rs30\plugin.xml to the attachment and let me know if that helps.

https://gist.github.com/mribbons/893935f94431b7a92d54#file-plugin-xml

mribbons commented 8 years ago

Hi @web-slinger, I noticed you forked the repo and seem to be making some progress.

Would you mind testing this repo again?

I would like to collaborate with you on further functionality, like exposing configuration options and getting back the barcode type - I hope you are interested.

web-slinger commented 8 years ago

Hi @mribbons,

Yes, I noticed the ClassNotFound Exception was to do with the out of date CipherLabAPI and my keyboard emulation didn't have true/false states only None/InputMethod/KeyEvent.

This repo now works :+1:

The scanning works great for me, getting the barcode type would be a necessity for my use. You can see I forced to show the barcode format then split the data with : to get the format. Which seems a wrong way of doing it. I'd prefer to get the barcode type as an integer in the result as below.

int iCodeType = intent.getIntExtra(GeneralString.BcReaderCodeType, 0);

Then add in the barcode type from that, I'll help out with this repo for sure! I have some documentation with the barcode type and their respective integers.

https://github.com/web-slinger/cordova-plugin-cipherlab-rs30/blob/master/www/CipherlabRS30CordovaPlugin.js

mribbons commented 8 years ago

Great, thanks @web-slinger

I have set up a couple of issues to cover these requirements.

https://github.com/mribbons/cordova-plugin-cipherlab-rs30/issues/4 https://github.com/mribbons/cordova-plugin-cipherlab-rs30/issues/5

Just a note on recompiling: I noticed that you were committing to the plugin repo each time you made a code change.

That makes the commit history a little messy. What you can do is work in a local directory. This way you don't need to commit code to get the changes. You do still have to readd the plugin with each change you make though. eg:

cordova plugin remove cordova-plugin-cipherlab-rs30
cordova plugin add ~/code/cordovoa-cipherlab-rs30

It's a bit of a hassle but it keeps the commits clean and it's faster than pushing to github.