lubritto / pdf_viewer_plugin

A Flutter plugin for IOS and Android providing a simple way to display PDFs.
MIT License
57 stars 65 forks source link

No implementation found for long com.shockwave.pdfium.PdfiumCore.nativeOpenDocument #39

Closed bulgariamitko closed 3 years ago

bulgariamitko commented 4 years ago

When trying to load PDF I am getting this error:

No implementation found for long com.shockwave.pdfium.PdfiumCore.nativeOpenDocument(int, java.lang.String) (tried Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument and Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument__ILjava_lang_String_2) E/PDFView (32314): load pdf error E/PDFView (32314): java.lang.UnsatisfiedLinkError: No implementation found for long com.shockwave.pdfium.PdfiumCore.nativeOpenDocument(int, java.lang.String) (tried Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument and Java_com_shockwave_pdfium_PdfiumCore_nativeOpenDocument__ILjava_lang_String_2) E/PDFView (32314): at com.shockwave.pdfium.PdfiumCore.nativeOpenDocument(Native Method) E/PDFView (32314): at com.shockwave.pdfium.PdfiumCore.newDocument(PdfiumCore.java:135) E/PDFView (32314): at com.github.barteksc.pdfviewer.source.FileSource.createDocument(FileSource.java:38) E/PDFView (32314): at com.github.barteksc.pdfviewer.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:53) E/PDFView (32314): at com.github.barteksc.pdfviewer.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:27) E/PDFView (32314): at android.os.AsyncTask$3.call(AsyncTask.java:378) E/PDFView (32314): at java.util.concurrent.FutureTask.run(FutureTask.java:266) E/PDFView (32314): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/PDFView (32314): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/PDFView (32314): at java.lang.Thread.run(Thread.java:919)

I created in android->app->proguard-rules.pro file with this inside: -keep class com.example. { *; } -keep class com.shockwave.* { ; } -keep class bg.release. { ; } -keep class com.shockwave. -keepclassmembers class com.shockwave. { ; }

I also added this code inside android->app->build.grandle: buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.debug signingConfig signingConfigs.release } }

Hannnes1 commented 4 years ago

Same thing happens to me. Seems to have happened in the 1.20 update of flutter

huybuidac commented 4 years ago

same here :(

huybuidac commented 4 years ago

Oh, just flutter clean, every thing works well :D

lubritto commented 3 years ago

Fixed on the latest version