Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2551] Ti.Barcode stops the app when opened

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsBarcode
Labels8.0.0.GA, android-8, barcode, ti.barcode
Reporterjosh.mocek
AssigneeJohn V Pataki
Created2019-06-04T17:22:25.000+0000
Updated2019-10-19T23:25:29.000+0000

Description

Using Ti.Barcode. If you press on 'Hello, World' and look at the console you will notice that it consoles
'*-*-*-*-*-*-* PAUSE BY OS *-*-*-*-*-*-*'
'*-*-*-*-*-*-* STOP BY OS *-*-*-*-*-*-*'
And if you press 'Cancel' or scan a barcode the console outputs
'*-*-*-*-*-*-* RESTARTED BY OS *-*-*-*-*-*-*'
'*-*-*-*-*-*-* START BY OS *-*-*-*-*-*-*'
'*-*-*-*-*-*-* RESUME BY OS *-*-*-*-*-*-*'
From what I notice it should not be affecting the activity. This is causing the barcode scanner to run slowly. Sometimes the barcode scanner is taking +30s to close in our production app. Here are the modules i'm using: https://github.com/appcelerator-modules/ti.barcode https://github.com/acktie/Acktie-Mobile-Android-Barcode https://github.com/mikefogg/BarcodeView

Attachments

FileDateSize
barcodeScanner.js2019-06-04T17:19:04.000+00001525
index.js2019-06-06T20:14:06.000+00002275
index.tss2019-06-06T20:14:27.000+0000116
index.xml2019-06-06T20:14:27.000+0000187
media.io_shortTiClip.mov2019-08-20T15:56:48.000+00007140743
Screen Shot 2019-06-13 at 8.50.51 AM.png2019-06-13T16:05:28.000+0000359719
tiapp.xml2019-06-04T17:18:41.000+00004176

Comments

  1. Sharif AbuDarda 2019-06-04

    Hello, Why are you using three different barcode module? The second and third one is a third party module. Also, looks to be not supported with the latest SDK 8.0.1.GA when I tried to test with your sample code. Did you try the ti.barcode module's example code? there it has everything you needed for the barcode scanning? The example code works like charm with the module. Try it yourself and let us know. Thanks.
  2. josh.mocek 2019-06-04

    @sharif barcodeScanner.js should be in the lib folder of the app project.
  3. Sharif AbuDarda 2019-06-06

    Yes, I tried that. The other module Acktie-Mobile-Android-Barcode is showing error and not supported with SDK 8.0.1.GA. Why are you using three different barcode module? Did you try the ti.barcode module's example code? there it has everything you needed for the barcode scanning. Thanks.
  4. josh.mocek 2019-06-06

    I updated the index files to remove those other modules. If you want to try that application. What I am talking about is that when Ti.Barcode is opened it fires the signal to pause and stop the activity and it shouldn't be doing that.
  5. josh.mocek 2019-06-13

    I also got an alert because this project has apparently been making api calls? !Screen Shot 2019-06-13 at 8.50.51 AM.png|thumbnail!
  6. Rene Pot 2019-06-18

    [~josh.mocek] regarding your latest comment, you probably have a login call in alloy.js
  7. Rakhi Mitro 2019-07-25

    Hello! Hope you are doing fine today. Would you please reply us regarding previous reviews? We are looking forward to your response.
  8. Rakhi Mitro 2019-08-18

    [~josh.mocek], I just wanted to follow up and check the status of your issue. Did you manage to resolve the problem? Let us know the update.
  9. josh.mocek 2019-08-19

    It still crashes for me
  10. Sharif AbuDarda 2019-08-19

    Hello [~josh.mocek], Can you please share a video that demonstrates the issue of pause the app activity when the ti barcode module is opened? We will investigate any issue with the ti.barcode module. The other third party module and the related issue, you have to reach out their support. Also, the reason you are getting API calls logged in the dashboard, possibly you have login calls in the allloy.js. Thanks.
  11. josh.mocek 2019-08-20

    I added a video
  12. Sharif AbuDarda 2019-09-02

    The video does not show the app crash. Also in the video, you haven't shown any barcode scanning to demonstrate the slow scanning. Can you please clear your issue? what exactly the issue for you? thanks.
  13. josh.mocek 2019-09-03

    The issue is that Using Ti.Barcode. If you press on 'Hello, World' and look at the console you will notice that it consoles
        '*-*-*-*-*-*-* PAUSE BY OS *-*-*-*-*-*-*'
        '*-*-*-*-*-*-* STOP BY OS *-*-*-*-*-*-*'
        
    And if you press 'Cancel' or scan a barcode the console outputs
        '*-*-*-*-*-*-* RESTARTED BY OS *-*-*-*-*-*-*'
        '*-*-*-*-*-*-* START BY OS *-*-*-*-*-*-*'
        '*-*-*-*-*-*-* RESUME BY OS *-*-*-*-*-*-*'
        
    It should not be calling those. In this small sample app it isn't crashing.
  14. Sharif AbuDarda 2019-09-17

    Hello, In your index.js file I see you are calling them in
        var consoleError = (str) => (() => console.error(str));
        var onPause = consoleError('*-*-*-*-*-*-* PAUSE BY OS *-*-*-*-*-*-*');
        var onResume = consoleError('*-*-*-*-*-*-* RESUME BY OS *-*-*-*-*-*-*');
        var onRestart = consoleError('*-*-*-*-*-*-* RESTARTED BY OS *-*-*-*-*-*-*');
        var onClose = consoleError('*-*-*-*-*-*-* CLOSE BY OS *-*-*-*-*-*-*');
        var onCreate = consoleError('*-*-*-*-*-*-* CREATE BY OS *-*-*-*-*-*-*');
        var onStop = consoleError('*-*-*-*-*-*-* STOP BY OS *-*-*-*-*-*-*');
        var onDestroy = consoleError('*-*-*-*-*-*-* DESTROY BY OS *-*-*-*-*-*-*');
        var onStart = consoleError('*-*-*-*-*-*-* START BY OS *-*-*-*-*-*-*');
        
        ..........
        
        
        
        function onWindowOpen() {
        	if (OS_ANDROID) {
        		$.index.activity.onPause = onPause;
        		$.index.activity.onResume = onResume;
        		$.index.activity.onRestart = onRestart;
        		$.index.activity.onClose = onClose;
        		$.index.activity.onCreate = onCreate;
        		$.index.activity.onStop = onStop;
        		$.index.activity.onDestroy = onDestroy;
        		$.index.activity.onStart = onStart;
        		var permissionsToRequest = ["CAMERA"];
        		permissionsToRequest = permissionsToRequest.map((str) => "android.permission." + str);
        		permissionsToRequest = permissionsToRequest.filter((perm) => !Ti.Android.hasPermission(perm));
        		if (permissionsToRequest.length > 0) {
        			Ti.Android.requestPermissions(permissionsToRequest, (e) => e);
        		}
        	} else if (OS_IOS) {
        		Ti.App.addEventListener('resume', onResume);
        		Ti.App.addEventListener('paused', onPause);
        	}
        	closeCamera();
        }
        
        $.index.open();
        
    I am not sure what is the problem here. Thanks.
  15. josh.mocek 2019-09-19

    Yes the consoles are consoling out correctly. The consoles are just functions assigned to the activities event listeners, that way when an activity event is consoled it consoles. For example: If you leave the app without killing it you will notice that '*-*-*-*-*-*-* PAUSE BY OS *-*-*-*-*-*-*' will be consoled out. If you go back into the app it will console '*-*-*-*-*-*-* RESUME BY OS *-*-*-*-*-*-*'. The problem is that when a user opens the Ti.Barcode module it pauses the OS and then stops the OS when it should console nothing. You will notice that it pauses and stops the OS by the consoles.
        '*-*-*-*-*-*-* RESTARTED BY OS *-*-*-*-*-*-*'
        '*-*-*-*-*-*-* START BY OS *-*-*-*-*-*-*'
        '*-*-*-*-*-*-* RESUME BY OS *-*-*-*-*-*-*'
        

JSON Source