Android pdfrenderer not working properly with 19 or 21 minsdk

3.2k views Asked by At

Making a program for Android L' using pdfrenderer the issue is

  1. when 'm running the emulator with minsdk = 21 ERROR - "emulator-5554 disconnected! Cancelling 'com.example.andro_pdf_two.MainActivity activity launch'!"
  2. when 'm trying to run the emulator at minsdk = 19 ERROR at logcat- java.lang.NoClassDefFoundError: android.graphics.pdf.PdfRenderer and Call requires API level 21 (current min is 19): android.graphics.pdf.PdfRenderer#openPage

I have done everything as suggested - resetting adb, resetting preferences...but nothing seems to be working can anyone help???

2

There are 2 answers

5
archon92 On

Call requires API level 21 (current min is 19): android.graphics.pdf.PdfRenderer#openPage

clearly states that you need a min sdk version of 21 and your app has a current api level of 19

set this in your manifest and try

<uses-sdk android:minSdkVersion="21" />
3
jay On

PDFRenderer assumes minimum API level - 21.

You can use android-pdfview for API level less than 21.