Home > Software engineering >  Fatal Exception in android studio
Fatal Exception in android studio

Time:01-27

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.intern_productdetails, PID: 7648 java.lang.IllegalArgumentException: Target must not be null.

its come like error in android studio

I used picasso dependencies android studio in recycleradapter

CodePudding user response:

You have to provide more details so we can help you.

The error message "Target must not be null" typically indicates that you are trying to load an image using Picasso library but the image URL or path is null.

To fix this, you'll need to check the URL or path that you are passing to Picasso to make sure it's not null. If it's null then you should handle it differently, such as by showing a default image or a placeholder.

Another possible cause for this error might be that the image URL is not correct, so you should check that the URL passed to Picasso is correct and accessible.

It is also possible that the error is caused by the context you are using to load the image using picasso. Make sure the context you are using is not null and it is the correct one.

It is recommended to check the Logcat output for more details and specific line of the error to identify the problem.

CodePudding user response:

private void setUserInfo1() { usersList1 = new ArrayList(); usersList1.add(new user1(1,"https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/dinosaur-nuggets-3-royalty-free-image-95315100-1562775854.jpg")); usersList1.add(new user1(2,"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS3h4Uw8sl9MU5TO7ssEHnLCvUEbHgNpR5azlxakz72Ieh5QkWBvfqz9wuGSXf7y2cOT7s&usqp=CAU")); usersList1.add(new user1(3,"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQG8DtVDixGiYTqxpkb0nu8Aef0on8R71qRjA&usqp=CAU")); }

this is the code I given to the url image for adapter in picasso

  • Related