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

PDF preview fails for release mode - No implementation found for long com.shockwave.pdfium.PdfiumCore.o #94

Open
CartmanGD opened this issue Apr 3, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@CartmanGD
Copy link

I'm using flutter_cached_pdfview: ^0.4.1.

Here is my code:

const PDF().cachedFromUrl(
        widget.fileUrl,
        placeholder: (progress) => Center(
          child: SizedBox(
            width: MediaQuery.of(context).size.width / 2.5,
            child: LinearProgressIndicator(
              value: progress / 100,
              color: Colors.white,
              backgroundColor: Colors.grey,
            ),
          ),
        ),
        errorWidget: (error) => Center(child: Text(error.toString())),
      )

Everything works just fine in debug mode, but running the app in release mode shows a blank screen instead of the PDF preview.

I got the above log in logcat:

04-03 18:36:31.360 29300 29749 E .tenant_app.dev: No implementation found for long com.shockwave.pdfium.PdfiumCore.o(int, java.lang.String) (tried Java_com_shockwave_pdfium_PdfiumCore_o and Java_com_shockwave_pdfium_PdfiumCore_o__ILjava_lang_String_2)

After disabling the shrinking option on build.gradle, the problem was solved.

android {
    ...
    buildTypes {
        release {
            ...
            minifyEnabled false
            shrinkResources false
            ...
        }
    }
}

It seems that there is an issue when shrinking this plugin.

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.6, on macOS 13.2.1 22D68 darwin-x64, locale en-IL)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.76.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
@CartmanGD CartmanGD added the bug Something isn't working label Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant