Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional dependicies #4

Open
Savrov opened this issue Aug 7, 2018 · 7 comments
Open

Additional dependicies #4

Savrov opened this issue Aug 7, 2018 · 7 comments

Comments

@Savrov
Copy link

Savrov commented Aug 7, 2018

To make lib work a have to add 2 dependencies:

implementation 'io.github.ponnamkarthik:richlinkpreview:1.0.8'
implementation 'org.jsoup:jsoup:1.11.2'
implementation 'com.squareup.picasso:picasso:2.5.2'

W/o that it doesnt work.

@ponnamkarthik
Copy link
Owner

@Savrov

I you want to add this library to your app you only need to add

implementation 'io.github.ponnamkarthik:richlinkpreview:1.0.8'

this to you project
remaining two dependencies are already included in library gradle file

@olyjosh
Copy link

olyjosh commented Aug 11, 2018

I'm having thesame issue, using implementation 'io.github.ponnamkarthik:richlinkpreview:1.0.8' does not work adding the decencies name given on stack-trace does not solve this. Below is a log that may be of help

E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
                  Process: ng.appname.appname, PID: 22317
                  java.lang.RuntimeException: An error occurred while executing doInBackground()
                      at android.os.AsyncTask.done(AsyncTask.java:318)
                      at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
                      at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
                      at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                      at android.os.AsyncTask$SerialExecutor.run(AsyncTask.java:243)
                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                      at java.lang.Thread.run(Thread.java:761)
                   Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jsoup/Jsoup;
                      at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.doInBackground(RichPreview.java:42)
                      at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.doInBackground(RichPreview.java:35)
                      at android.os.AsyncTask.call(AsyncTask.java:304)
                      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                      at android.os.AsyncTask$SerialExecutor.run(AsyncTask.java:243) 
                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
                      at java.lang.Thread.run(Thread.java:761) 
                   Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jsoup.Jsoup" on path: DexPathList[[zip file "/data/app/ng.appname.appname-1/base.apk", zip file "/data/app/ng.appname.appname-1/split_lib_dependencies_apk.apk", zip file "/data/app/ng.appname.appname-1/split_lib_slice_0_apk.apk", zip file "/data/app/ng.appname.appname-1/split_lib_slice_1_apk.apk", zip file "/data/app/ng.appname.appname-1/split_lib_slice_2_apk.apk", zip file "/data/app/ng.appname.appname-1/split_lib_slice_3_apk.apk", zip file "/data/app/ng.appname.appname-1/split_lib_slice_4_apk.apk", zip file "/data/app/ng.appname.appname-1/split_lib_slice_5_apk.apk", zip file "/data/app/ng.appname.appname-1/split_lib_slice_6_apk.apk", zip file "/data/app/ng.appname.appname-1/split_lib_slice_7_apk.apk", zip file "/data/app/ng.appname.appname-1/split_lib_slice_8_apk.apk", zip file "/data/app/ng.appname.appname-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/ng.appname.appname-1/lib/arm64, /data/app/ng.appname.appname-1/base.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/ng.appname.appname-1/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/vendor/lib64]]
                      at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                      at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
                      at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                      at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.doInBackground(RichPreview.java:42) 
                      at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.doInBackground(RichPreview.java:35) 
                      at android.os.AsyncTask.call(AsyncTask.java:304) 
                      at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
                      at android.os.AsyncTask$SerialExecutor.run(AsyncTask.java:243) 
                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
                      at java.lang.Thread.run(Thread.java:761) 

On adding the two dependencies, app crashes with the below log pointing to picaso.

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: ng.appname.appname, PID: 14071
                  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/ng.appname.appname-2/split_lib_dependencies_apk.apk)
                      at io.github.ponnamkarthik.richlinkpreview.RichLinkViewTwitter.initView(RichLinkViewTwitter.java:83)
                      at io.github.ponnamkarthik.richlinkpreview.RichLinkViewTwitter$2.onData(RichLinkViewTwitter.java:162)
                      at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.onPostExecute(RichPreview.java:156)
                      at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.onPostExecute(RichPreview.java:35)
                      at android.os.AsyncTask.finish(AsyncTask.java:663)
                      at android.os.AsyncTask.-wrap1(AsyncTask.java)
                      at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:680)
                      at android.os.Handler.dispatchMessage(Handler.java:111)
                      at android.os.Looper.loop(Looper.java:207)
                      at android.app.ActivityThread.main(ActivityThread.java:5728)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

I guess there is a breaking change in picaso against the version you used in building this

@Gh0stWires
Copy link

I second @Savrov post. adding those dependencies with those specific versions does fix the problem. like @olyjosh said updates to those dependencies may be causing breaking changes to your library. I may try to fix these issues myself and submit a pull request but for right now adding those dependencies work well enough for me.

@gigiperih
Copy link

@ponnamkarthik seems this library using previous version of Picasso. It has different method when initializing the Picasso.

Picasso 2.7++
Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);

Older version of Picasso need to parse Context.

Further reading:
https://futurestud.io/tutorials/picasso-how-to-use-migrate-to-picassos-upcoming-3-x-version

@ShahoodulHassan
Copy link

Any solution for this issue.......?

@ismailnurudeen
Copy link

I already had picasso dependency in my project so the only error i got was with jsoup.

Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jsoup/Jsoup;
     at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.doInBackground(RichPreview.java:42)
     at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.doInBackground(RichPreview.java:35)
     at android.os.AsyncTask$2.call(AsyncTask.java:333)
     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
     at java.lang.Thread.run(Thread.java:764) 
  Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jsoup.Jsoup" on path: DexPathList[[zip file "/data/app/ng.com.devloop.stirp-3LHyXhiAlF4S7Pp_VYJEJA==/base.apk"],nativeLibraryDirectories=[/data/app/ng.com.devloop.stirp-3LHyXhiAlF4S7Pp_VYJEJA==/lib/arm, /system/lib, /vendor/lib]]
     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
     at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.doInBackground(RichPreview.java:42) 
     at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.doInBackground(RichPreview.java:35) 
     at android.os.AsyncTask$2.call(AsyncTask.java:333) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
     at java.lang.Thread.run(Thread.java:764) 
 
 
 --------- beginning of system

@jatin-lakhani
Copy link

implementation 'io.github.ponnamkarthik:richlinkpreview:1.0.9'

java.lang.NoSuchMethodError: No static method get()Lcom/squareup/picasso/Picasso; in class Lcom/squareup/picasso/Picasso;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants