RadaeePDF.com :: Topic: Error building new app: package R does not exist (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: Error building new app: package R does not exist

Error building new app: package R does not exist 2 years 8 months ago #8244

  • cray
  • cray's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 1
Hi,
I'm having trouble getting my application to build after using the directions provided in the SDK guide. When attempting to make the project I get a "error: package R does not exist".
I've been experimenting with the sample pdfviewer app (3.3) in Android Studio but need to try it in my own app before purchasing a license. I have followed the instructions in the guide but can not build the new project.
I have the pdfviewer app building properly in Android Studio and kept the same working structure for the new app. When attempting to make the project I get the following error:

http://tinypic.com/r/118m9td/8

To simplify debugging, I started a new project, verified it could build, then only followed the directions in the guide to add the libraries (but using the updated gradle structure instead of ADT layout):


From the original import of the pdfviewer into Android Studio:
* AndroidManifest.xml => app/src/main/AndroidManifest.xml
* assets/ => app/src/main/assets/
* libs/arm64-v8a/librdpdf.so => app/src/main/jniLibs/arm64-v8a/librdpdf.so
* libs/armeabi-v7a/librdpdf.so => app/src/main/jniLibs/armeabi-v7a/librdpdf.so
* libs/armeabi/librdpdf.so => app/src/main/jniLibs/armeabi/librdpdf.so
* libs/com.radaee.view.jar => app/libs/com.radaee.view.jar
* libs/mips/librdpdf.so => app/src/main/jniLibs/mips/librdpdf.so
* libs/mips64/librdpdf.so => app/src/main/jniLibs/mips64/librdpdf.so
* libs/x86/librdpdf.so => app/src/main/jniLibs/x86/librdpdf.so
* libs/x86_64/librdpdf.so => app/src/main/jniLibs/x86_64/librdpdf.so
* lint.xml => app/lint.xml
* res/ => app/src/main/res/
* src/ => app/src/main/java/

Below is the current directory structure:

http://tinypic.com/r/24look3/8

Any thoughts?
The administrator has disabled public write access.

Error building new app: package R does not exist 2 years 8 months ago #8250

  • nermeen
  • nermeen's Avatar
  • OFFLINE
  • Moderator
  • Posts: 683
  • Thank you received: 40
  • Karma: 18
Did you add the jar to build.gradle dependencies?

You can also check our new structred SDK, its native part is the same as the latest stable release.
www.androidpdf.mobi/download/download-pr...fviewer-sdk-34alfaas
The administrator has disabled public write access.

Error building new app: package R does not exist 2 years 8 months ago #8291

  • cray
  • cray's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 1
Thanks nermeen...

I was successful in using ViewLib included in the 3.4 android studio distro you provided in the previous post. It was very straightforward...

My only issue is utilizing the 'design' view of the layout. When including the com.radaee.reader,PDFLayoutView widget, I get an error:
java.lang.UnsupportedOperationException: Unsupported Service: activity
	at com.android.layoutlib.bridge.android.BridgeContext.getSystemService(BridgeContext.java:458)
	at com.radaee.reader.PDFLayoutView.onDraw(PDFLayoutView.java:524)
	at android.view.View.draw(View.java:14465)
	at android.view.View.draw(View.java:14350)
	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
	at android.view.View.draw(View.java:14348)
	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
	at android.view.View.draw(View.java:14348)
	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
	at android.view.View.draw(View.java:14468)
	at android.view.View.draw(View.java:14350)
	at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
	at android.view.View.draw(View.java:14468)
	at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:578)
	at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:339)
	at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
	at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:688)
	at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:677)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
	at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:677)
	at com.android.tools.idea.rendering.RenderService.render(RenderService.java:815)
	at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)
	at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
	at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
	at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
	at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
	at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
	at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
	at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
	at com.intellij.util.Alarm$Request$1.run(Alarm.java:327)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
	at java.lang.Thread.run(Thread.java:695)

The app runs fine but the preview fails. This occurs in both the "PDFReader" sample app and in my test app.

To duplicate with the sample app, open PDFSample/PDFReader/src/main/res/layout/pdf_layout.xml and select the 'Design' tab.
The administrator has disabled public write access.
Powered by Kunena Forum