Reputation: 2411
I am trying to load image in imageview but for some image my app is crashing while i am trying to get bitmap from image path.
Here is my code:
public Bitmap getBitmap(String imagePath){
Bitmap bitmap = BitmapFactory.decodeFile(imagePath);
return bitmap;
}
Log:
Process: kgs.com.librarytest2, PID: 17587
java.lang.NoClassDefFoundError: Failed resolution of:
Ljavax/imageio/ImageIO;
at it.lamba.utils.KImageCheck.analyzeImage(KImageCheck.kt:26)
at it.lamba.utils.KImageCheck.getImageData(KImageCheck.kt:53)
at com.kitegamesstudio.kgspicker.ui.PickerFragment.handleSelection(PickerFragment.kt:524)at com.kitegamesstudio.kgspicker.ui.PickerFragment$getPagerAdapter$selectionDe legate$1.onItemSelected(PickerFragment.kt:494) at com.kitegamesstudio.kgspicker.ui.PagerFragment$selectionDelegate$1.onItemS lected(PagerFragment.kt:35) at com.kitegamesstudio.kgspicker.ui.RecyclerViewAdapter$ImageItemVieHolder$bi d$$inlined$with$lambda$1.onClick(RecyclerViewAdapter.kt:125) at android.view.View.performClick(View.java:6392)
Upvotes: 2
Views: 911
Reputation: 1007296
Note that your code (a getBitmap()
method) is unrelated to your stack trace, which does not refer to this method.
You appear to be using this library. It is designed for use with Java SE, on a desktop or a server. It is using javax.imageio.ImageIO
, which is not part of the Android SDK. You will need to remove this library from your project.
Upvotes: 1