2017-12-14 21 views
2

나는 카메라갤러리에서 이미지를 픽업하기 위해 TedBottomPicker 라이브러리를 사용했습니다. 또한 내 프로젝트에 Glide을 사용하고 있습니다. 최근에 Glide 라이브러리를 최신 버전으로 업데이트했으며 TedBottomPicker 라이브러리도 업데이트했습니다. 이제 TedBottomPicker 라이브러리를 사용하여 카메라 또는 갤러리에 액세스하는 동안 문제가 발생했습니다.java.lang.NoSuchMethodError : 가상 메소드로드 없음 (Landroid/net/Uri;) Lcom/bumptech/glide/DrawableTypeRequest;

FATAL EXCEPTION: main
Process: com.fooddoof.fuddict, PID: 2284 java.lang.NoSuchMethodError: No virtual method load(Landroid/net/Uri;)Lcom/bumptech/glide/DrawableTypeRequest; in class Lcom/bumptech/glide/RequestManager; or its super classes (declaration of 'com.bumptech.glide.RequestManager' appears in /data/app/com.fooddoof.fuddict-1/split_lib_dependencies_apk.apk) at gun0912.tedbottompicker.adapter.GalleryAdapter.onBindViewHolder(GalleryAdapter.java:163) at gun0912.tedbottompicker.adapter.GalleryAdapter.onBindViewHolder(GalleryAdapter.java:32) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6508) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6541) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5484) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5750) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5589) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5585) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2231) at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:556) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1518) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:610) at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3719) at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3135) at android.view.View.measure(View.java:19734) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:758) at android.widget.LinearLayout.onMeasure(LinearLayout.java:640) at android.view.View.measure(View.java:19734) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.view.View.measure(View.java:19734) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120) at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:719) at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:791) at android.view.View.measure(View.java:19734) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.view.View.measure(View.java:19734) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139) at android.view.View.measure(View.java:19734) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.view.View.measure(View.java:19734) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at android.view.View.measure(View.java:19734) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464) at android.widget.LinearLayout.measureVertical(LinearLayout.java:758) at android.widget.LinearLayout.onMeasure(LinearLayout.java:640) at android.view.View.measure(View.java:19734) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6120) at android.widget.FrameLayout.onMeasure(FrameLayout.java:185) at com.android.internal.policy.DecorView.onMeasure(DecorView.java:687)
12-14 09:52:42.908 2284-2284/com.fooddoof.fuddict E/AndroidRuntime:
at android.view.View.measure(View.java:19734) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2271) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1358) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1607) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6301) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871) at android.view.Choreographer.doCallbacks(Choreographer.java:683) at android.view.Choreographer.doFrame(Choreographer.java:619) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

위 예외는 logcat에 표시됩니다. 다른 다른 라이브러리에서도 시도했지만이 오류가 발생했습니다. 라이브러리를 액세스

내 종속성

dependencies { 
implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'com.android.support:appcompat-v7:27.0.2' 
compile 'com.android.volley:volley:1.0.0' 
compile 'gun0912.ted:tedbottompicker:1.1.0' 
compile 'com.github.bumptech.glide:glide:4.4.0' 
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0' 
compile 'com.github.chrisbanes:PhotoView:2.0.0' 
compile 'de.hdodenhof:circleimageview:2.2.0' 
compile 'uk.co.chrisjenx:calligraphy:2.3.0' 
compile 'com.android.support:multidex:1.0.2' 
compile 'gun0912.ted:tedpermission:2.1.0' 
compile 'com.android.support:recyclerview-v7:27.0.2' 
} 

PermissionListener permissionlistener1 = new PermissionListener() { 
    @Override 
    public void onPermissionGranted() { 

       TedBottomPicker tedBottomPicker = new TedBottomPicker.Builder(PostActivity.this) 
          .setOnImageSelectedListener(new TedBottomPicker.OnImageSelectedListener() { 
           @Override 
           public void onImageSelected(Uri uri) { 
            // here is selected uri 
           } 
          }) 
          .create(); 

tedBottomPicker.show(getSupportFragmentManager()); 
    } 

    @Override 
    public void onPermissionDenied(ArrayList<String> deniedPermissions) { 
     Toast.makeText(PostActivity.this, "Permission Denied\n" + deniedPermissions.toString(), Toast.LENGTH_SHORT).show(); 
    } 
}; 

갤러리 Adapter.java는

public class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.MyViewHolder> { 

private ArrayList<descusers> images; 
private Context mContext; 

public class MyViewHolder extends RecyclerView.ViewHolder { 
    public ImageView thumbnail; 

    public MyViewHolder(View view) { 
     super(view); 
     thumbnail = view.findViewById(R.id.thumbnail); 
    } 
} 

public GalleryAdapter(Context context, ArrayList<descusers> images) { 
    mContext = context; 
    this.images = images; 
} 

@Override 
public GalleryAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 
    View itemView = LayoutInflater.from(parent.getContext()) 
      .inflate(R.layout.gallery_thumbnail, parent, false); 
    return new MyViewHolder(itemView); 
} 


@Override 
public void onBindViewHolder(GalleryAdapter.MyViewHolder holder, int position) { 
    descusers image = images.get(position); 
    Glide.with(mContext).load(image.getimage()) 
      .into(holder.thumbnail); 
} 

@Override 
public int getItemCount() { 
    return images.size(); 
} 


public interface ClickListener { 
    void onClick(View view, int position); 

    void onLongClick(View view, int position); 
} 

public static class RecyclerTouchListener implements RecyclerView.OnItemTouchListener { 

    private GestureDetector gestureDetector; 
    private GalleryAdapter.ClickListener clickListener; 

    public RecyclerTouchListener(Context context, final RecyclerView recyclerView, final GalleryAdapter.ClickListener clickListener) { 
     this.clickListener = clickListener; 
     gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() { 
      @Override 
      public boolean onSingleTapUp(MotionEvent e) { 
       return true; 
      } 

      @Override 
      public void onLongPress(MotionEvent e) { 
       View child = recyclerView.findChildViewUnder(e.getX(), e.getY()); 
       if (child != null && clickListener != null) { 
        clickListener.onLongClick(child, recyclerView.getChildAdapterPosition(child)); 
       } 
      } 
     }); 
    } 

    @Override 
    public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) { 
     View child = rv.findChildViewUnder(e.getX(), e.getY()); 
     if (child != null && clickListener != null && gestureDetector.onTouchEvent(e)) { 
      clickListener.onClick(child, rv.getChildAdapterPosition(child)); 
     } 
     return false; 
    } 

    @Override 
    public void onTouchEvent(RecyclerView rv, MotionEvent e) { 

    } 

    @Override 
    public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) { 

    } 
    } 
} 
+0

작동하는 글라이드 버전을 다운 그레이드하십시오. 4.0의 'RequestManager' 클래스 문제 ... https://github.com/myinnos/AwesomeImagePicker/issues/11을 참조하십시오. – R2R

+0

@JacobCelestine - 어떤 코드 부분을 사용합니까? 이 문제를 해결해야합니까? – user2269164

+0

@JacobCelestine - 갤러리 아답터 – user2269164

답변

0

나는 오류가 무엇인지 이해합니다. 라이브러리 TedBottomPicker 글라이드 버전 3.6.1을 사용하고 있습니다. 하지만 v4의 글라이드를 사용합니다. 이 두 가지를 동시에 사용할 수 없으므로 오류가 발생합니다.

  • 어느 다운 그레이드 TedBottomPicker
  • 사용 자신의 프로젝트를 업그레이드 할 TedBottomPicker의 개발자에게 문의
  • TedBottomPicker
  • 이외의 다른 프로젝트하여 버전을 사용하는 프로젝트
    : 당신은 지금 이러한 옵션이
  • 프로젝트에 TedBottomPicker을 가져오고 모든 방법을 직접 다시 작성하십시오.

희망이 도움이됩니다.