안녕하세요 여러분, 피카소를 사용하여 이미지보기에 이미지를 넣으려고 할 때 문제가 있습니다. 예외 : IllegalArgumentException가 :Picasso : java.lang.IllegalArgumentException : 대상이 null이 아니어야합니다.
오류지고 전체 코드를 공용 클래스 UserProfileActivity을 대상 코드 여기
.into(UserProfilePhoto);
이 줄에 널 (null)이 아니어야입니다 것은 AppCompatActivity 확장 { 민간 최종 AppCompatActivity 활동 = UserProfileActivity .이;
xml의 이미지 뷰는 여기에 정의 된 것과 동일하므로 왜 작동하지 않는지 잘 모릅니다.
java.lang.RuntimeException: Unable to start activity ComponentInfo{ie.coffeepal.coffeepal/ie.coffeepal.coffeepal.activities.UserProfileActivity}: java.lang.IllegalArgumentException: Target must not be null.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.IllegalArgumentException: Target must not be null.
at com.squareup.picasso.RequestCreator.into(RequestCreator.java:618)
at com.squareup.picasso.RequestCreator.into(RequestCreator.java:601)
at ie.coffeepal.coffeepal.activities.UserProfileActivity.onCreate(UserProfileActivity.java:49)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
답변을 주셔서 감사합니다. 코드를 업데이트하고 빌드 한 후 다시 실행했지만 오류가 여전히 발생하고 있습니다. 나는 새로운 오류 – skittels
으로 게시물을 업데이 트했습니다. getresources(). getstring()을 사용하여 URL을 가져와야합니다. profilePhoto – rafsanahmad007
또한 레이아웃과 이미지 뷰 ID가 올바른지 확인하십시오. – rafsanahmad007