google-code-export / tibar

Automatically exported from code.google.com/p/tibar
1 stars 0 forks source link

Assertion failure in -[ZBarReaderViewController setTakesPicture:], /Users/spadix/zbar/hg/sdk-merge/iphone/ZBarReaderViewController.m:381 #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi!

I'm using Tibar in an iPhone module. I'm actually testing your project (and I 
love it: very efficient!).
But recently, I had an issue.
I have a simple code as in your example:

button.addEventListener('click', function(){
    TiBar.scan({
        // simple configuration for iPhone simulator
        configure: {
        classType: "ZBarReaderViewController"
        ,sourceType: "Camera" // Library(C), Camera(VC), Album(C)
        //,cameraMode: "Default" // Default, Sampling, Sequence
        ,config:{
            "showsCameraControls":false // (VC) true
            ,"showsZBarControls":true
            ,"tracksSymbols":true
            ,"enableCache":true
            ,"showsHelpOnFail":true
            ,"takesPicture":true // true
        },symbol:{
            "QR-Code":true,
            "CODE-128":true,
            "CODE-39":true,
            "I25":true,
            "DataBar":true,
            "DataBar-Exp":true,
            "EAN-13":true,
            "EAN-8":true,
            "UPC-A":true,
            "UPC-E":true,
            //"ISBN-13":true,
            //"ISBN-10":true,
            "PDF417":true
        }
    },
    success:function(data){
        Ti.API.info('TiBar success callback!');
        if(data && data.barcode){
            Ti.UI.createAlertDialog({
                title: "Scan result",
                message: "Barcode: " + data.barcode + " Symbology:" + data.symbology
            }).show();
        }
    },
    cancel:function(){
        Ti.API.info('TiBar cancel callback!');
    },
    error:function(){
        Ti.API.info('TiBar error callback!');
    }
    });        
});

When i load my app on my iPhone, I have the normal page with the 'Scan barcode' 
button. But when I click on it, it freezes and I have this log:

[DEBUG] classType: ZBarReaderViewController
[DEBUG] sourceType: Camera
[DEBUG] config
[DEBUG] key: showsCameraControls value: 0
[DEBUG] key: showsZBarControls value: 1
[DEBUG] key: tracksSymbols value: 1
[DEBUG] key: enableCache value: 1
[DEBUG] key: showsHelpOnFail value: 1
[DEBUG] key: takesPicture value: 1
2011-01-08 21:37:29.379 TestProject[389:307] *** Assertion failure in 
-[ZBarReaderViewController setTakesPicture:], 
/Users/spadix/zbar/hg/sdk-merge/iphone/ZBarReaderViewController.m:381
[DEBUG] symbol
[DEBUG] QR-Code 1
[DEBUG] CODE-128 1
[DEBUG] CODE-39 1
[DEBUG] I25 1
[DEBUG] DataBar 1
[DEBUG] DataBar-Exp 1
[DEBUG] EAN-13 1
[DEBUG] EAN-8 1
[DEBUG] UPC-A 1
[DEBUG] UPC-E 1
[DEBUG] ISBN-13 (null)
[DEBUG] ISBN-10 (null)
[DEBUG] PDF417 1

As you can see, it searches a file into : /Users/spadix/...
And spadix seems to be a developper of Zbar (http://zbar.sourceforge.net/)

Do you know this issue?

For info, I'm using an iPhone 3GS, with iOs 4.1.2. I compile for iOS 4.1 (and 
4.2, it's the same issue).

Original issue reported on code.google.com by rmnsal...@gmail.com on 8 Jan 2011 at 8:51

GoogleCodeExporter commented 9 years ago
hi,

your problem is here:

http://sourceforge.net/projects/zbar/forums/forum/1072195/topic/3925029/index/pa
ge/2

the sample app hangs, you can build from scratch  is you compile the module 
with Zbar SDK beta 1.1...

Original comment by ploun...@me.com on 11 Jan 2011 at 8:37

GoogleCodeExporter commented 9 years ago
We will update TiBar next week.

Lukasz

Original comment by lukasz.r...@gmail.com on 14 Jan 2011 at 2:40

GoogleCodeExporter commented 9 years ago
Perfect, thx u very much!

Original comment by rmnsal...@gmail.com on 15 Jan 2011 at 5:20

GoogleCodeExporter commented 9 years ago

Original comment by lukasz.r...@gmail.com on 27 Jan 2011 at 4:00

GoogleCodeExporter commented 9 years ago
There is new relase, TiBar 0.4.2:
http://code.google.com/p/tibar/downloads/detail?name=tibar-iphone-0.4.2.zip

Please test it with different devices and iOS versions and post the results:
http://code.google.com/p/tibar/issues/detail?id=13

Best regards,
Lukasz

Original comment by lukasz.r...@gmail.com on 31 Jan 2011 at 12:09

GoogleCodeExporter commented 9 years ago
Hi there. neither the 0.4.2 fixes the "Assertion failure in 
-[ZBarReaderViewController setCameraMode:]"

any ideas?

[DEBUG] classType: ZBarReaderViewController
[DEBUG] sourceType: Camera
[DEBUG] cameraMode: Default
2011-02-15 22:24:12.998 TestProject[13814:307] *** Assertion failure in 
-[ZBarReaderViewController setCameraMode:], 
/Users/spadix/zbar/hg/sdk-merge/iphone/ZBarReaderViewController.m:380
[DEBUG] config
[DEBUG] key: showsCameraControls value: 1
2011-02-15 22:24:13.028 TestProject[13814:307] *** Assertion failure in 
-[ZBarReaderViewController setShowsCameraControls:], 
/Users/spadix/zbar/hg/sdk-merge/iphone/ZBarReaderViewController.m:378
[DEBUG] key: showsZBarControls value: 0
[DEBUG] key: tracksSymbols value: 1
[DEBUG] key: enableCache value: 1
[DEBUG] key: showsHelpOnFail value: 0
[DEBUG] key: takesPicture value: 0

Original comment by sebastia...@gmail.com on 15 Feb 2011 at 9:32

GoogleCodeExporter commented 9 years ago
But the scan works anyway... Am I wrong?

Original comment by rmnsal...@gmail.com on 15 Feb 2011 at 9:40

GoogleCodeExporter commented 9 years ago
no, I don't even get the camera opened. if the scan would work, it would be ok 
for me.

i'm testing on iPhone 3GS.

With the "normal" ZBarReaderController mode, everything works fine.

Original comment by sebastia...@gmail.com on 15 Feb 2011 at 9:47

GoogleCodeExporter commented 9 years ago
It works for me. I'm testing on iPhone 3GS with iOS 4.2. And I compile my 
application for iOS 4.1
My params should be the same than upper:

                    classType: "ZBarReaderViewController",
                    sourceType: "Camera", // Library(C), Camera(VC), Album(C)
                    cameraMode: "Default", // Default, Sampling, Sequence
                    config: {
                        "showsCameraControls": false, // (VC) true
                        "showsZBarControls": true,
                        "tracksSymbols": true,
                        "enableCache": true,
                        "showsHelpOnFail": true,
                        "takesPicture": true
                    },
                    symbol: {
                        "QR-Code": true,
                        "CODE-128": true,
                        "CODE-39": true,
                        "I25": true,
                        "DataBar": true,
                        "DataBar-Exp": true,
                        "EAN-13": true,
                        "EAN-8": true,
                        "UPC-A": true,
                        "UPC-E": true,
                        "ISBN-13": true,
                        "ISBN-10": true,
                        "PDF417": true

Original comment by rmnsal...@gmail.com on 15 Feb 2011 at 9:56

GoogleCodeExporter commented 9 years ago
I'm at work now, but I will have a try this evening and report my luck/fail.

Original comment by sebastia...@gmail.com on 16 Feb 2011 at 3:14

GoogleCodeExporter commented 9 years ago
ok, I tried to compile for iOS 4.2 with your configuration. That fails.

do I have achance to get the 4.1 SDK or compile it with 4.1? 

Original comment by sebastia...@gmail.com on 17 Feb 2011 at 10:57

GoogleCodeExporter commented 9 years ago
You don't need the sdk 4.1 to compile for 4.1.
You just have to choose before the compilation.

In Titanium, just select the SDK in the field 'Select SDK version' (cf. 
screenshot).
In Xcode: open your xcode project under 
'[projectName]/build/iphone/[projectName].xcodeproj'. Then, click on you 
project name (1), then 'build' tab (2), 'All Configurations' (3) and then : 
'iOS Deployment Target (4)

But if it doesn't work with 4.2, I'm afraid it won't with 4.1...

Original comment by rmnsal...@gmail.com on 17 Feb 2011 at 11:16

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for that. 

ok, so I tried several ways. Compiled in 4.1 or 4.2. 
I did the changes in my project configuration. the result is the same as it was.

*** Assertion failure in -[ZBarReaderViewController setTakesPicture:], 
/Users/spadix/zbar/hg/sdk-merge/iphone/ZBarReaderViewController.m:381

I don't understand why it works in your project and neither in mine.

Original comment by sebastia...@gmail.com on 17 Feb 2011 at 12:31

GoogleCodeExporter commented 9 years ago
And try to put 'takesPicture' to 0.
Because as your can see in your log, it's 'setTakedPicture' which has a problem.

Original comment by rmnsal...@gmail.com on 17 Feb 2011 at 1:24

GoogleCodeExporter commented 9 years ago
done, next message: *** Assertion failure in -[ZBarReaderViewController 
setCameraMode:], 
/Users/spadix/zbar/hg/sdk-merge/iphone/ZBarReaderViewController.m:380

cameraMode is set with "Default", or isn't it? I took your config

Original comment by sebastia...@gmail.com on 17 Feb 2011 at 1:43

GoogleCodeExporter commented 9 years ago
In my config, it's written:

cameraMode: "Default", // Default, Sampling, Sequence

Maybe you can try with : 'Sequence' and 'Sampling'...

Original comment by rmnsal...@gmail.com on 17 Feb 2011 at 2:00

GoogleCodeExporter commented 9 years ago
all 3 possibilities (Default, Sampling, Sequence) fails in

[INFO] [object TibarModule] loaded
[DEBUG] loading: /var/mobile/Applications/XXXX/TestApp.app/tibar.js, resource: 
tibar_js
[DEBUG] args

[DEBUG] configure

[DEBUG] classType: ZBarReaderViewController
[DEBUG] sourceType: Camera
[DEBUG] cameraMode: Sequence
2011-02-17 15:25:02.637 TestApp[15004:307] *** Assertion failure in 
-[ZBarReaderViewController setCameraMode:], 
/Users/spadix/zbar/hg/sdk-merge/iphone/ZBarReaderViewController.m:380
[DEBUG] config
[DEBUG] key: showsCameraControls value: 0
[DEBUG] key: showsZBarControls value: 1
[DEBUG] key: tracksSymbols value: 1
[DEBUG] key: enableCache value: 1
[DEBUG] key: showsHelpOnFail value: 1
[DEBUG] key: takesPicture value: 0
[DEBUG] symbol
[DEBUG] QR-Code 1
[DEBUG] CODE-128 1
[DEBUG] CODE-39 1
[DEBUG] I25 1
[DEBUG] DataBar 1
[DEBUG] DataBar-Exp 1
[DEBUG] EAN-13 1
[DEBUG] EAN-8 1
[DEBUG] UPC-A 1
[DEBUG] UPC-E 1
[DEBUG] ISBN-13 1
[DEBUG] ISBN-10 1
[DEBUG] PDF417 1

The camera doesn't appear

Original comment by sebastia...@gmail.com on 17 Feb 2011 at 2:27

GoogleCodeExporter commented 9 years ago
There is another parameter you can modify, but it won't be as cool:

classType: "ZBarReaderController"

If I have well understood, with this parameter you take a photo, and the 
barcode is not detected by the video camera.

Original comment by rmnsal...@gmail.com on 17 Feb 2011 at 2:34

GoogleCodeExporter commented 9 years ago
that works. and it's totally uncool. that isnt, what i'm looking for. 

ZBarReaderViewController would be nice to work with

Original comment by sebastia...@gmail.com on 17 Feb 2011 at 2:37

GoogleCodeExporter commented 9 years ago
anybody any idea, how to get the ZBarReaderViewController instead of 
ZBarReaderController working?

Original comment by sebastia...@gmail.com on 18 Feb 2011 at 6:54

GoogleCodeExporter commented 9 years ago
try only with QR code. does it work?

Original comment by yankees2...@gmail.com on 18 Feb 2011 at 7:33

GoogleCodeExporter commented 9 years ago
no, unfortunately not

Original comment by sebastia...@gmail.com on 19 Feb 2011 at 10:59

GoogleCodeExporter commented 9 years ago
Just a thought.
In your tiapp.xml, have you precised:

<modules>
    <module version="0.4.2">tibar</module>
</modules>

Original comment by rmnsal...@gmail.com on 22 Feb 2011 at 11:30

GoogleCodeExporter commented 9 years ago
yes, exactly that version

<modules>
    <module version="0.4.2">tibar</module>
</modules>

Original comment by sebastia...@gmail.com on 23 Feb 2011 at 10:03

GoogleCodeExporter commented 9 years ago
If your project is not too secret, I can test in my 3GS if you want. Thus, we 
will know if it comes from your code or somewhere else.

Original comment by rmnsal...@gmail.com on 23 Feb 2011 at 10:07

GoogleCodeExporter commented 9 years ago
I think about it. can you add me in ICQ please? then we coult talk on...
236742661

Original comment by sebastia...@gmail.com on 23 Feb 2011 at 3:00

GoogleCodeExporter commented 9 years ago
I have sent you an email.

Original comment by rmnsal...@gmail.com on 23 Feb 2011 at 3:35

GoogleCodeExporter commented 9 years ago
Solved by following the Comments 2 and 3 of the issue 10: 
http://code.google.com/p/tibar/issues/detail?id=10

Original comment by rmnsal...@gmail.com on 23 Feb 2011 at 9:21

GoogleCodeExporter commented 9 years ago
Tested on iphone 4G with iOS 4.3. Using the 1.5.2 SDK from the continuos 
appcelerator builds, everything works great. Make sure you follow all steps to 
setup the modues, include frameworks, etc etc. Try the newest 4.3 SDK maybe 
that will help

Original comment by spalatn...@gmail.com on 23 Feb 2011 at 10:19

GoogleCodeExporter commented 9 years ago
problem is solved. whatever it was, creating a new xcode project and everything 
works fine. thanks for all, who helped me. 

Original comment by sebastia...@gmail.com on 24 Feb 2011 at 1:16