- Posts: 4
- 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
Android ndk crash: Documents.SetCache error
IP: 192.168.0.71
11 years 8 months ago #8297
by Hewie
Android ndk crash: Documents.SetCache error was created by Hewie
Hello
I have a project used pdf sdk 2.9.3 (not demo project)
now I try to update to 3.3.4
When I opened my pdf document than I will get error log like below
It look like Documents.SetCache error
I already check it was called only once
I have no idea to fix it
please help me, thank you
01-12 15:41:36.039: I/System.out(12627): Doc path = /storage/emulated/0/rdtmp/temp.dat
01-12 15:41:36.039: W/dalvikvm(12627): Invalid indirect reference 0x6d47dc1c in decodeIndirectRef
01-12 15:41:36.039: I/dalvikvm(12627): "main" prio=5 tid=1 RUNNABLE
01-12 15:41:36.039: I/dalvikvm(12627): | group="main" sCount=0 dsCount=0 obj=0x415dd578 self=0x415c8150
01-12 15:41:36.039: I/dalvikvm(12627): | sysTid=12627 nice=0 sched=0/0 cgrp=apps handle=1074839548
01-12 15:41:36.039: I/dalvikvm(12627): | state=R schedstat=( 0 0 0 ) utm=220 stm=52 core=1
01-12 15:41:36.039: I/dalvikvm(12627): at com.radaee.pdf.Document.setCache(Native Method)
01-12 15:41:36.039: I/dalvikvm(12627): at com.radaee.pdf.Document.SetCache(Document.java:311)
01-12 15:41:36.039: I/dalvikvm(12627): at cc.nexdoor.standalonepdfreader.PDFReaderActivity.openDocument(PDFReaderActivity.java:647)
01-12 15:41:36.039: I/dalvikvm(12627): at cc.nexdoor.standalonepdfreader.PDFReaderActivity.onCreate(PDFReaderActivity.java:277)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.Activity.performCreate(Activity.java:5133)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
01-12 15:41:36.039: I/dalvikvm(12627): at android.os.Handler.dispatchMessage(Handler.java:99)
01-12 15:41:36.039: I/dalvikvm(12627): at android.os.Looper.loop(Looper.java:137)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.ActivityThread.main(ActivityThread.java:5103)
01-12 15:41:36.039: I/dalvikvm(12627): at java.lang.reflect.Method.invokeNative(Native Method)
01-12 15:41:36.039: I/dalvikvm(12627): at java.lang.reflect.Method.invoke(Method.java:525)
01-12 15:41:36.039: I/dalvikvm(12627): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
01-12 15:41:36.039: I/dalvikvm(12627): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-12 15:41:36.039: I/dalvikvm(12627): at dalvik.system.NativeStart.main(Native Method)
01-12 15:41:36.039: E/dalvikvm(12627): VM aborting
01-12 15:41:36.039: A/libc(12627): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 12627 (udconference.ly)
and this is my code
private void openDocument(String filename) {
mDocuments = new Document();
int ret = mDocuments.Open(filename, "");
mReader = (PDFReader) findViewById(R.id.view);
System.out.println("Doc path = " + Global.tmp_path + "/temp.dat");
mDocuments.SetCache( Global.tmp_path + "/temp.dat" ); //ERROR
mReader.PDFOpen(mDocuments, false, this);
//Add ThumbView
m_thumb = (PDFThumbView)m_layout.findViewById(R.id.thumbs);
m_thumb.thumbOpen(mReader.PDFGetDoc(), this);
this.mReader.SetThumbView(m_thumb);
mLinestylePopup = new LineStylePopup(
LayoutInflater.from(this).inflate(R.layout.pop_linepaint, null), this);
//Create pdfpageview
Log.i("Gridview", "generate gridview");
pagegridview = new PageGridView(this);
PDFPageAdapter newlist = new PDFPageAdapter(getApplicationContext(), mReader.PDFGetDoc());
pagegridview.setAdapter(newlist);
pagegridview.setOnItemClickListener(this);
}
I have a project used pdf sdk 2.9.3 (not demo project)
now I try to update to 3.3.4
When I opened my pdf document than I will get error log like below
It look like Documents.SetCache error
I already check it was called only once
I have no idea to fix it
please help me, thank you
01-12 15:41:36.039: I/System.out(12627): Doc path = /storage/emulated/0/rdtmp/temp.dat
01-12 15:41:36.039: W/dalvikvm(12627): Invalid indirect reference 0x6d47dc1c in decodeIndirectRef
01-12 15:41:36.039: I/dalvikvm(12627): "main" prio=5 tid=1 RUNNABLE
01-12 15:41:36.039: I/dalvikvm(12627): | group="main" sCount=0 dsCount=0 obj=0x415dd578 self=0x415c8150
01-12 15:41:36.039: I/dalvikvm(12627): | sysTid=12627 nice=0 sched=0/0 cgrp=apps handle=1074839548
01-12 15:41:36.039: I/dalvikvm(12627): | state=R schedstat=( 0 0 0 ) utm=220 stm=52 core=1
01-12 15:41:36.039: I/dalvikvm(12627): at com.radaee.pdf.Document.setCache(Native Method)
01-12 15:41:36.039: I/dalvikvm(12627): at com.radaee.pdf.Document.SetCache(Document.java:311)
01-12 15:41:36.039: I/dalvikvm(12627): at cc.nexdoor.standalonepdfreader.PDFReaderActivity.openDocument(PDFReaderActivity.java:647)
01-12 15:41:36.039: I/dalvikvm(12627): at cc.nexdoor.standalonepdfreader.PDFReaderActivity.onCreate(PDFReaderActivity.java:277)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.Activity.performCreate(Activity.java:5133)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
01-12 15:41:36.039: I/dalvikvm(12627): at android.os.Handler.dispatchMessage(Handler.java:99)
01-12 15:41:36.039: I/dalvikvm(12627): at android.os.Looper.loop(Looper.java:137)
01-12 15:41:36.039: I/dalvikvm(12627): at android.app.ActivityThread.main(ActivityThread.java:5103)
01-12 15:41:36.039: I/dalvikvm(12627): at java.lang.reflect.Method.invokeNative(Native Method)
01-12 15:41:36.039: I/dalvikvm(12627): at java.lang.reflect.Method.invoke(Method.java:525)
01-12 15:41:36.039: I/dalvikvm(12627): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
01-12 15:41:36.039: I/dalvikvm(12627): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-12 15:41:36.039: I/dalvikvm(12627): at dalvik.system.NativeStart.main(Native Method)
01-12 15:41:36.039: E/dalvikvm(12627): VM aborting
01-12 15:41:36.039: A/libc(12627): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 12627 (udconference.ly)
and this is my code
private void openDocument(String filename) {
mDocuments = new Document();
int ret = mDocuments.Open(filename, "");
mReader = (PDFReader) findViewById(R.id.view);
System.out.println("Doc path = " + Global.tmp_path + "/temp.dat");
mDocuments.SetCache( Global.tmp_path + "/temp.dat" ); //ERROR
mReader.PDFOpen(mDocuments, false, this);
//Add ThumbView
m_thumb = (PDFThumbView)m_layout.findViewById(R.id.thumbs);
m_thumb.thumbOpen(mReader.PDFGetDoc(), this);
this.mReader.SetThumbView(m_thumb);
mLinestylePopup = new LineStylePopup(
LayoutInflater.from(this).inflate(R.layout.pop_linepaint, null), this);
//Create pdfpageview
Log.i("Gridview", "generate gridview");
pagegridview = new PageGridView(this);
PDFPageAdapter newlist = new PDFPageAdapter(getApplicationContext(), mReader.PDFGetDoc());
pagegridview.setAdapter(newlist);
pagegridview.setOnItemClickListener(this);
}
IP: 192.168.0.71
11 years 8 months ago #8303
by radaee
Replied by radaee on topic Android ndk crash: Documents.SetCache error
to upgrade from 2.9.3 to 3.3.4:
1. replace libs subdir to your project
2. replace package "com.radaee.pdf" to your project
3. merge or replace other packages, if any error.
because ver 3.X use 64 bits integer as handle value, native function all changed.
for SetCache method:
mDocuments.SetCache( Global.tmp_path + "/temp.dat" );
to be sure Global.tmp_path + "/temp.dat" only used in 1 PDF Document, at one time.
1. replace libs subdir to your project
2. replace package "com.radaee.pdf" to your project
3. merge or replace other packages, if any error.
because ver 3.X use 64 bits integer as handle value, native function all changed.
for SetCache method:
mDocuments.SetCache( Global.tmp_path + "/temp.dat" );
to be sure Global.tmp_path + "/temp.dat" only used in 1 PDF Document, at one time.
Time to create page: 0.441 seconds