SubhamTyagi / loco-answers

Open Source Android App for answers in TRIVIA GAMES
GNU General Public License v3.0
195 stars 47 forks source link

Ocr not working on Android 10 #426

Open Jayanthbm opened 4 years ago

Jayanthbm commented 4 years ago

App Crashing when i click start OCR

To Reproduce Steps to reproduce the behavior:

  1. Go to 'App'
  2. Click on 'Start OCR'
  3. Select the profile
  4. See error

Expected behavior App closing

Smartphone (please complete the following information):

SubhamTyagi commented 4 years ago

Could you send the all files from Folder 'TriviaHack/errors'?

Jayanthbm commented 4 years ago

the directory doesn't exists on my phone I'm sending the zip of ai.loko.hk.ui ai.loko.hk.ui.zip

SubhamTyagi commented 4 years ago

@Jayanthbm Have you allowed the storage permission for app?

Jayanthbm commented 4 years ago

Yes i allowed storage permission Interestingly previous version of trivia hack is working fine

grasdaggl commented 4 years ago

Hi Subham,

first of all: thank you for the awesome app, it sure helps to beat those quizzes ;) I have the same problem on Android 10 on my Pixel 2XL. The App now crashes as soon as I click "get Answers". It didn't log an error, but I logged it with logcat and got this error:

 Process: ai.loko.hk.ui, PID: 5403
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Intent.clone()' on a null object reference
        at ai.loko.hk.ui.ocr.MediaProjectionHelper.getMediaProjection(MediaProjectionHelper.java:56)
        at ai.loko.hk.ui.ocr.Screenshotter.takeScreenshot(Screenshotter.java:92)
        at ai.loko.hk.ui.services.OCRFloating$2.onClick(OCRFloating.java:181)
        at android.view.View.performClick(View.java:7140)
        at android.view.View.performClickInternal(View.java:7117)
        at android.view.View.access$3500(View.java:801)
        at android.view.View$PerformClick.run(View.java:27351)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        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)

i hope this helps :)

kr Michael