- Posts: 2
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Error building new app: package R does not exist
IP: 192.168.0.71
11 years 2 months ago #8244
by cray
Error building new app: package R does not exist was created by cray
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:
Below is the current directory structure:
http://tinypic.com/r/24look3/8
Any thoughts?
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:
Code:
* 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?
IP: 192.168.0.158
11 years 2 months ago #8250
by nermeen
Replied by nermeen on topic Error building new app: package R does not exist
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
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
IP: 192.168.0.71
11 years 2 months ago #8291
by cray
Replied by cray on topic Error building new app: package R does not exist
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:
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.
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:
Code:
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.
Time to create page: 0.410 seconds