Telerik-Verified-Plugins / ImagePicker

Cordova Plugin For Multiple Image Selection
MIT License
182 stars 331 forks source link

Unfortunately app closed !!! #88

Open AnandKumar2610 opened 7 years ago

AnandKumar2610 commented 7 years ago

When i call this code

try { this.imagePicker.getPictures({maximumImagesCount: 5}).then((results) => { for (let i = 0; i < results.length; i++) { try { let result = results[i]; } catch (e) { break; } } }, (err) => { }); } catch(e){ } then app will be unfortunately closed.

I also tired remove plugin and add plugin link: https://ionicframework.com/docs/native/image-picker/ Is there any solutions? Thanks in advance -Anand

jalescardoso commented 7 years ago

in /platforms/android/project.properties remove all other com.android.support:support and com.android.support:appcompat and leave the latest ones. as:

cordova.system.library.9=com.android.support:support-v13:26.+
cordova.system.library.7=com.android.support:appcompat-v7:26.+
AnandKumar2610 commented 7 years ago

Hi @jalescardoso Thank you for your reply. Kindly share your /platforms/android/project.properties code... This my code target=android-26 android.library.reference.1=CordovaLib cordova.system.library.1=com.android.support:appcompat-v7:23+ cordova.gradle.include.1=com.synconset.imagepicker/starter-ignorelinterrors.gradle cordova.gradle.include.2=com.synconset.imagepicker/starter-androidtarget.gradle cordova.system.library.2=com.android.support:support-v4:25.+ cordova.system.library.3=com.android.support:appcompat-v7:25.+ cordova.system.library.4=com.android.support:support-v4:+ cordova.gradle.include.3=phonegap-plugin-barcodescanner/starter-barcodescanner.gradle

What changes i need?

jalescardoso commented 7 years ago

@AnandKumar2610 your project.properties should look like this:

target=android-26 
android.library.reference.1=CordovaLib 

cordova.gradle.include.1=com.synconset.imagepicker/starter-ignorelinterrors.gradle 
cordova.gradle.include.2=com.synconset.imagepicker/starter-androidtarget.gradle 

cordova.system.library.3=com.android.support:appcompat-v7:25.+ 
cordova.system.library.4=com.android.support:support-v4:+ 
cordova.gradle.include.3=phonegap-plugin-barcodescanner/starter-barcodescanner.gradle
AnandKumar2610 commented 7 years ago

@jalescardoso am tired but same error, app will be closed unexpectedly but its working fine in IONIC VIEW app. I'm confused why this happen...

jalescardoso commented 7 years ago

@AnandKumar2610 The application conflicts with the various version of com.android.support:appcompat and com.android.support:support and some plugins have unexpected behaviors. so I advise leaving only the latest version of these libraries.

AnandKumar2610 commented 7 years ago

@jalescardoso Thank you for your reply! Actually its working fine while i using ionic 2, in few days ago i updated to ionic 3 so reason is ionic 3 is not supported in this plugin ? then why its runs fine in IONIC VIEW app?

jalescardoso commented 7 years ago

@AnandKumar2610 you may need to update every application.

AnandKumar2610 commented 7 years ago

@jalescardoso I skipped this plugin 'Image Picker', now am using camera plugin its working fine for pick a image.. Code: https://ionicframework.com/docs/native/camera/ Thank you..

jalescardoso commented 7 years ago

I own an application in production that works perfectly: https://play.google.com/store/apps/details?id=com.valorsoft.aluguelapp

AnandKumar2610 commented 7 years ago

hi @jalescardoso I found the actual error plz find below...

06:53:37 E AndroidRuntime : FATAL EXCEPTION: main 06:53:37 E AndroidRuntime : Process: io.ionic.starter, PID: 7436 06:53:37 E AndroidRuntime : java.lang.NoSuchMethodError: No static method getScreenWidthDp(Landroid/content/res/Resources;)I in class Landroid/support/v4/content/res/ConfigurationHelper; or its super classes (declaration of 'android.support.v4.content.res.ConfigurationHelper' appears in /data/app/io.ionic.starter-1/base.apk) 06:53:37 E AndroidRuntime : at android.support.v7.view.ActionBarPolicy.getMaxActionButtons(ActionBarPolicy.java:57) 06:53:37 E AndroidRuntime : at android.support.v7.widget.ActionMenuPresenter.initForMenu(ActionMenuPresenter.java:108) 06:53:37 E AndroidRuntime : at android.support.v7.view.menu.MenuBuilder.addMenuPresenter(MenuBuilder.java:264) 06:53:37 E AndroidRuntime : at android.support.v7.widget.Toolbar.setMenu(Toolbar.java:569) 06:53:37 E AndroidRuntime : at android.support.v7.widget.ToolbarWidgetWrapper.setMenu(ToolbarWidgetWrapper.java:369) 06:53:37 E AndroidRuntime : at android.support.v7.widget.ActionBarOverlayLayout.setMenu(ActionBarOverlayLayout.java:714) 06:53:37 E AndroidRuntime : at android.support.v7.app.AppCompatDelegateImplV9.preparePanel(AppCompatDelegateImplV9.java:1362) 06:53:37 E AndroidRuntime : at android.support.v7.app.AppCompatDelegateImplV9.doInvalidatePanelMenu(AppCompatDelegateImplV9.java:1648) 06:53:37 E AndroidRuntime : at android.support.v7.app.AppCompatDelegateImplV9$1.run(AppCompatDelegateImplV9.java:140) 06:53:37 E AndroidRuntime : at android.os.Handler.handleCallback(Handler.java:739) 06:53:37 E AndroidRuntime : at android.os.Handler.dispatchMessage(Handler.java:95) 06:53:37 E AndroidRuntime : at android.os.Looper.loop(Looper.java:135) 06:53:37 E AndroidRuntime : at android.app.ActivityThread.main(ActivityThread.java:5343) 06:53:37 E AndroidRuntime : at java.lang.reflect.Method.invoke(Native Method) 06:53:37 E AndroidRuntime : at java.lang.reflect.Method.invoke(Method.java:372) 06:53:37 E AndroidRuntime : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 06:53:37 E AndroidRuntime : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

In Android mobiles, how can i fix this issue?

Mr-Anonymous commented 6 years ago

hi @AnandKumar2610 did you fix this issue? I noticed that this plugin causes the Android app to crash randomly when selecting images from gallery.

AnandKumar2610 commented 6 years ago

@Mr-Anonymous fixed that issue. Try this solution. https://github.com/Telerik-Verified-Plugins/ImagePicker/issues/90#issuecomment-352025341

Mr-Anonymous commented 6 years ago

Thank you @AnandKumar2610 for getting back to me.

So you are now using the forked version from shaik305? Is that working fine for ios 11 and Android latest versions?

I am just a little reluctant to use a fork that is edited by an individual cuz I cant see what changes were done when compared to the main repo and also any new changes in the main repo may not necessary be updated in these individual fork. So I am concerned on that.

Also, I started using this plugin since the wymsee/cordova-imagePicker is not maintained and has a lot of issues. But it appears even this Telerik-Verified-Plugins/ImagePicker plugin has not been maintained or updated for a long time now. Now that ios 11 and Android 8 is out, I dont know how long this or the shaik305's forked version will continue to work before my users will start having issues. As it is a v popular plugin that a lot of hybrid app will need, what do app developers do? Are they still using this unmaintained plugins? Is there another reliable alternative for this plugin?

Thanks again for your reply.

AnandKumar2610 commented 6 years ago

@Mr-Anonymous I have tested that plugin in Android 8.0 it's working fine but i don't know about IOS devices. In features we need to maintain or upgrade our app's that only solution.

Mr-Anonymous commented 6 years ago

Just an update on this. I have moved over to the Media Picker plugin which I feel works really good and it also looks very good in Android. Here is the link if its helps:

https://github.com/dmcBig/cordova-plugin-mediaPicker

I didnt have these issues in the Media Picker plugin, the ones I was facing with this Telerik Image Picker plugin. So I feel it is a very good alternative.

ashish701ranjan commented 5 years ago

@Mr-Anonymous Are you using the https://github.com/dmcBig/cordova-plugin-mediaPicker in an ionic project? I couldn't find any Ionic-native library which provides a support for mediaPicker. How do you use it in your components/pages? (I am using Ionic 4)