Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSPDFKit is not initialized crash after system kills app #29

Open
1 task done
mlykotom opened this issue Oct 9, 2019 · 2 comments
Open
1 task done

PSPDFKit is not initialized crash after system kills app #29

mlykotom opened this issue Oct 9, 2019 · 2 comments

Comments

@mlykotom
Copy link

mlykotom commented Oct 9, 2019

Description of the Issue

App is crashing after system kills it. It is very similar to #23 but with different cause.

Versions Used

Preview SDK: 3.0.3
Android: any

Steps to Reproduce

  1. open preview activity (with properly setup box session and data)
  2. put the app to background
  3. kill the app adb shell ps | grep your.app.package | awk '{print $2}' | xargs adb shell run-as your.app.package kill
  4. open the app and see crash due to missing context

Error Message, Including Stack Trace

     Caused by: com.pspdfkit.exceptions.PSPDFKitNotInitializedException: PSPDFKit is not initialized!
        at com.pspdfkit.ui.PdfFragment.onCreate(SourceFile:1031)
        at androidx.fragment.app.Fragment.performCreate(Fragment.java:2586)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:838)
        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
        at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2659)
        at androidx.fragment.app.FragmentManagerImpl.dispatchCreate(FragmentManagerImpl.java:2607)
        at androidx.fragment.app.FragmentController.dispatchCreate(FragmentController.java:235)
        at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:316)
        at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:106)
        at com.box.androidsdk.preview.ext.BoxThreadPoolExecutorActivity.onCreate(SourceFile:70)
        at com.box.androidsdk.preview.BoxPreviewActivity.onCreate(SourceFile:78)
        at android.app.Activity.performCreate(Activity.java:7802)
        at android.app.Activity.performCreate(Activity.java:7791)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
@mlykotom
Copy link
Author

this causes significant amount of crashes in our app .. any news of resolving???

@asthagarg2428
Copy link

I also faced this issue but while executing unit tests for my code which was calling PSPDF specific method internally.

I solved it by creating instrument test case instead of unit test case As the initialisation was already happening when Application installs.

Hope it helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants