2

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???

Remees M Syde
  • 2,564
  • 1
  • 19
  • 42
Diya
  • 107
  • 1
  • 11

2 Answers2

1

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" />
archon92
  • 447
  • 3
  • 13
  • Thanx, but still with minsdk = 21 ERROR msg- "emulator-5554 disconnected! Cancelling 'com.example.andro_pdf_two.MainActivity activity launch'...what can i do to fix it?? – Diya Dec 05 '14 at 05:39
  • Pls install android Lolipop Sdk first and use an emulator which uses the 5.0 sdk – archon92 Dec 05 '14 at 05:40
  • I have already installed wat was required..in sdk manager but still its shows the same error..cant post snapshot of sdk manager..any other suggestions...? – Diya Dec 05 '14 at 06:24
  • Still the same error - " emulator-5554 disconnected! Cancelling 'com.example.andro_pdf_two.MainActivity activity launch'!" – Diya Dec 05 '14 at 06:50
  • Even if you install the Lolipop SDK in the sdk manager it does not mean that your emulator will be running lollipop. Create a new emulator that runs a lollipop image. The error message you are getting is telling you that you are trying to run an application that requires a min sdk of 21 onto a device thats 19. – startoftext Dec 10 '14 at 17:19
0

PDFRenderer assumes minimum API level - 21.

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

jay
  • 1,982
  • 2
  • 24
  • 54
  • These are all PDF viewer apps, not libraries. How is this supposed to help OP? – zyamys May 30 '16 at 05:11
  • Each library has its corresponding viewer. I have used android-pdfview. http://stackoverflow.com/questions/24183472/how-to-open-pdf-in-android-using-pdfview – jay May 30 '16 at 18:51
  • Again, these links are apps, not libraries. Yes, android-pdfview is a library, which you just added to the list, and is the only correct answer. The rest are of no help. – zyamys May 30 '16 at 19:00