java.lang.NoSuchMethodError: No static method with(Landroid/content/Context;)Lcom/squareup/picasso/Picasso;


I think this is a library compatibility issue but its worth giving it a shot.

I am trying to implement an image slider in my app and Picasso library is throwing a fit, it is giving me noSuchMethodError.

Okay I am concating two strings, one is name displayed on slider and other is the activity type and then I'm putting in a hashmap and key splitting keys and loading in .image.

 for (String key : image_list.keySet()   ) {

                String[] keySplit = key.split("@@@");
                String nameOfDeal = keySplit[0];
                String typeOfActivity = keySplit[1];

When I log nameOfDeal and image_list.get(key) is correctly formatted. Any ideas? Below is my code.

I initialized a SliderLayout and

 //Create TextSlider
 final TextSliderView textSliderView = new TextSliderView(getBaseContext());
  textSliderView.description(nameOfDeal)
                        .image(image_list.get(key))
                        .setScaleType(BaseSliderView.ScaleType.Fit)
                        .setOnSliderClickListener(new 
   BaseSliderView.OnSliderClickListener() {
   @Override
   public void onSliderClick(BaseSliderView slider) 
    {

  Intent intent = new Intent(MainActivity.this, main_intermediate.class);

   intent.putExtras(textSliderView.getBundle());
                                startActivity(intent);
 }
});

 textSliderView.bundle(new Bundle());                
 textSliderView.getBundle().putString("uniqueID",typeOfActivity);
 mSlider.addSlider(textSliderView);

MY LOGCAT

11-08 20:51:01.456 1575-1575/com.example.karam.nlcg E/AndroidRuntime: FATAL 
EXCEPTION: main
Process: com.example.karam.nlcg, PID: 1575
java.lang.NoSuchMethodError: No static method 
with(Landroid/content/Context;)Lcom/squareup/picasso/Picasso; in class 
Lcom/squareup/picasso/Picasso; or its super classes (declaration of 
'com.squareup.picasso.Picasso' appears in /data/app/com.example.karam.nlcg- 
hOIyNfHuyD9O29FGhzu4EQ==/split_lib_dependencies_apk.apk)
    at com.daimajia.slider.library. 
 SliderTypes.BaseSliderView.bindEventAndShow(BaseSliderView.java:210)
    at com.daimajia.slider.library.' 
SliderTypes.TextSliderView.getView(TextSliderView.java:25)
    at com.daimajia.slider.library.
 SliderAdapter.instantiateItem(SliderAdapter.java:81)
    at com.daimajia.slider.library.
 Tricks.InfinitePagerAdapter.instantiateItem(InfinitePagerAdapter.java:54)
    at com.daimajia.slider.library.Tricks
.ViewPagerEx.addNewItem(ViewPagerEx.java:848)
    at com.daimajia.slider.library.Tricks.
ViewPagerEx.populate(ViewPagerEx.java:998)
    at com.daimajia.slider.library.Tricks.
ViewPagerEx.setCurrentItemInternal(ViewPagerEx.java:562)
    at c 

 om.daimajia.slider.library.Tricks.
  ViewPagerEx.setCurrentItemInternal(ViewPagerEx.java:526)
    at com.daimajia.slider.library.Tricks.ViewPagerEx.
setCurrentItem(ViewPagerEx.java:507)
    at 

com.daimajia.slider.library.Indicators.
PagerIndicator$1.onChanged(PagerIndicator.java:411)
    at android.database.DataSetObservable.notifyChanged
 (DataSetObservable.java:37)
    at 

 android.support.v4.view.PagerAdapter.
notifyDataSetChanged(PagerAdapter.java:293)
    at 
 com.daimajia.slider.library.SliderAdapter.addSlider(SliderAdapter.java:28)
    at 
  com.daimajia.slider.library.SliderLayout.addSlider(SliderLayout.java:237)
    at 
com.example.karam.nlcg.MainActivity$3.onDataChange(MainActivity.java:292)
    at com.google.firebase.database.core.ValueEventRegistration.
 fireEvent(com.google.firebase:[email protected]@16.0.4:75)
    at com.google.firebase.database.core.view.DataEvent.fire
 (com.google.firebase:[email protected]@16.0.4:63)
    at 


com.google.firebase.database.core.view.EventRaiser$1
.run(com.google.firebase:fir 
[email protected]@16.0.4:55)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6938)
    at java.lang.reflect.Method.invoke(Native Method)
    at 
com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
- - Source

Answers

answered 6 day ago KARAM JABER #1

if anybody faces this problem, damijana, the guy who made the library is no longer supporting it.

But firdausmaulan is a developer and he made a library which is really not different that damijana, but it uses glide instead of picasso.

LINK TO github project: https://github.com/firdausmaulan/GlideSlider

LINK to example: https://github.com/firdausmaulan/GlideSlider-Example/blob/feature/1.3.2/app/src/main/java/com/glide/slider/example/MainActivity.java

comments powered by Disqus