wymsee / cordova-imagePicker

Cordova Plugin For Multiple Image Selection
MIT License
407 stars 858 forks source link

app will crash in Android and "null" value in ios #3

Closed bau720123 closed 10 years ago

bau720123 commented 10 years ago

when I use this method

window.imagePicker.getPictures(
    function(results) {
        for (var i = 0; i < results.length; i++) {
            alert('Image URI: ' + results[i]);
        }
    }, function (error) {
        alert('Error: ' + error);
    }, {
        maximumImagesCount: 10,
        width: 800
    }
);

in Android it will immediately crash the app http://www.littlebau.com/ImagePicker_crash.png

in ios it always alert the "null" http://www.littlebau.com/ImagePicker_ios01.png http://www.littlebau.com/ImagePicker_ios02.png

finally~I found a way to solve the ios problem it must be add a "height" attribute

{
maximumImagesCount: 10,
width: 800,
height: 600,
}

otherwise it will always got a "null" value (for now)

jakecraige commented 10 years ago

I have the same error. You have to specify a height or it will return null as the error on iOS. I haven't tried android

allie-wake-up commented 10 years ago

Ok, this should be an easy fix. I'll take a look at it tonight or tomorrow.

bau720123 commented 10 years ago

thanks @TheKiteEatingTree

bau720123 commented 10 years ago

hi @TheKiteEatingTree I just do a more test it seem only Android 4.0X will crash the app (because of my 4.11 or 4.21 are normal,maybe > 4.2 are normal too) feedback this imformation to you

allie-wake-up commented 10 years ago

Could the android issue be related to issue #2? Also, are you using phonegap build? That fix probably isn't in the phonegap build version. I'll update it once I fix the height problem in iOS. If you're not using phonegap build and the plugin is up to date then it's probably another bug.

bau720123 commented 10 years ago

hi @TheKiteEatingTree it look like that the #2 issues to made this crash problem in 4.0X,thanks you letting me know I am using phonegap build 3.3 (build.phonegap.com),so I will wait for your plugin's new version

thanks above~

allie-wake-up commented 10 years ago

I pushed what I believe is the fix for the height problem to the height branch. I didn't bring my mac home so I'll have to test it tomorrow. If everything's good then I'll submit all of the bug fixes to phonegap build.

bau720123 commented 10 years ago

thanks @TheKiteEatingTree again~

allie-wake-up commented 10 years ago

I submitted the update to phonegap build, so hopefully it's there soon. They say it could take a week.

bau720123 commented 10 years ago

thanks @TheKiteEatingTree

bau720123 commented 10 years ago

hi @TheKiteEatingTree the 1.0.1 version have fully solve the article problem,tks~ https://build.phonegap.com/plugins/690 I will close it by myself