FolioReader / FolioReader-Android

A Java ePub reader and parser framework for Android.
BSD 3-Clause "New" or "Revised" License
2.24k stars 710 forks source link

No static field abc_text_select_handle_middle_mtrl_dark of type I in class Lcom/folioreader/R$drawable #501

Open hnvmeta opened 3 years ago

hnvmeta commented 3 years ago

My Project uses androidx.appcompat:appcompat:1.3.0 lib. When I read an epub file, app will crash. In my opinion, it happens because the lib 1.3.0 lacks abc_text_select_handle_middle_mtrl_dark drawables. App runs on Android API 22.

java.lang.NoSuchFieldError: No static field abc_text_select_handle_middle_mtrl_dark of type I in class Lcom/folioreader/R$drawable; or its superclasses (declaration of 'com.folioreader.R$drawable' appears in /data/app/com.minapp.documentreader-1/base.apk:classes2.dex) at com.folioreader.ui.view.FolioWebView.initViewTextSelection(FolioWebView.kt:253) at com.folioreader.ui.view.FolioWebView.init(FolioWebView.kt:245) at com.folioreader.ui.view.FolioWebView.setFolioActivityCallback(FolioWebView.kt:373) at com.folioreader.ui.fragment.FolioPageFragment.initWebView(FolioPageFragment.kt:361) at com.folioreader.ui.fragment.FolioPageFragment.onCreateView(FolioPageFragment.kt:174)

amkrys commented 3 years ago

you can comment that line as its no use

priyank-dt commented 2 years ago

Also i have same error. Please solved it and update.

jabahum commented 2 years ago

change androidx.appcompat:appcompat:1.3.0 back to 'androidx.appcompat:appcompat:1.2.0'

it actually worked for me

priyank-dt commented 2 years ago

Thank you @jabahum-coder. It works.

prilaga commented 2 years ago

Put these drawables to mdpi, hdpi, xhdpi, xxhdpi directories:

abc_text_select_handle_middle_mtrl_dark abc_text_select_handle_middle_mtrl_dark abc_text_select_handle_middle_mtrl_dark abc_text_select_handle_middle_mtrl_dark

bhoominn commented 2 years ago

Same issue, can anyone help me?

bhoominn commented 2 years ago

Same issue, can anyone help me?

Fix this issue by removing paytm package.

rachnayeSangeeta commented 2 years ago

Hi, It started crashing all of a sudden in iOS, don't know what the reason is but it was working before and no issue is showing why it is crashing, in android as per your suggestion @bhoominn its working, @bhoominn please help me out, and if anyone have solution please let me, I need help

bhoominn commented 2 years ago

remove other payment gateway packages, if used any.

rachnayeSangeeta commented 2 years ago

I already removed but still getting issue

bhoominn commented 2 years ago

I already removed but still getting issue

Show full error log here.

rachnayeSangeeta commented 2 years ago

I already removed but still getting issue

Show full error log here. [+5009 ms] flutter: Directory: '/Users/sangeetasingh/Library/Developer/CoreSimulator/Devices/0153F3B2-827C-4754-889B-724D0BE9CF9E/data/Containers/Data/Application/106684D3-084A-4FF6 -8E0C-EF2F88933F33/Documents' [ +7 ms] flutter: /Users/sangeetasingh/Library/Developer/CoreSimulator/Devices/0153F3B2-827C-4754-889B-724D0BE9CF9E/data/Containers/Data/Application/106684D3-084A-4FF6- 8E0C-EF2F88933F33/Documents/TwentyThousandLeaguesunderthesea.epub [ +368 ms] Service protocol connection closed. [ +1 ms] Lost connection to device. [ +5 ms] DevFS: Deleting filesystem on the device (file:///Users/sangeetasingh/Library/Developer/CoreSimulator/Devices/0153F3B2-827C-4754-889B-724D0BE9CF9E/data/Containers/Data/Application/106684D3-08 4A-4FF6-8E0C-EF2F88933F33/tmp/rachnaye_projectzyKota/rachnaye_project/) [ +271 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed [ +27 ms] "flutter run" took 49,343ms. [ +290 ms] ensureAnalyticsSent: 254ms [ +5 ms] Running shutdown hooks [ +2 ms] Shutdown hook priority 4 [ +5 ms] Shutdown hooks complete [ +2 ms] exiting with code 0

rachnayeSangeeta commented 2 years ago

I already removed but still getting issue

Show full error log here. [+5009 ms] flutter: Directory: '/Users/sangeetasingh/Library/Developer/CoreSimulator/Devices/0153F3B2-827C-4754-889B-724D0BE9CF9E/data/Containers/Data/Application/106684D3-084A-4FF6 -8E0C-EF2F88933F33/Documents' [ +7 ms] flutter: /Users/sangeetasingh/Library/Developer/CoreSimulator/Devices/0153F3B2-827C-4754-889B-724D0BE9CF9E/data/Containers/Data/Application/106684D3-084A-4FF6- 8E0C-EF2F88933F33/Documents/TwentyThousandLeaguesunderthesea.epub [ +368 ms] Service protocol connection closed. [ +1 ms] Lost connection to device. [ +5 ms] DevFS: Deleting filesystem on the device (file:///Users/sangeetasingh/Library/Developer/CoreSimulator/Devices/0153F3B2-827C-4754-889B-724D0BE9CF9E/data/Containers/Data/Application/106684D3-08 4A-4FF6-8E0C-EF2F88933F33/tmp/rachnaye_projectzyKota/rachnaye_project/) [ +271 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed [ +27 ms] "flutter run" took 49,343ms. [ +290 ms] ensureAnalyticsSent: 254ms [ +5 ms] Running shutdown hooks [ +2 ms] Shutdown hook priority 4 [ +5 ms] Shutdown hooks complete [ +2 ms] exiting with code 0

Only that error is throwing

rachnayeSangeeta commented 2 years ago

I find the issue, its happen due to memory issue, Thanks for your help @bhoominn

rachnayeSangeeta commented 2 years ago

remove other payment gateway packages, if used any.

@bhoominn How i manage cashfree payment and epubviewer both in app, because when i use cashfree payment then again epubviewer crash?

bhoominn commented 2 years ago

remove other payment gateway packages, if used any.

@bhoominn How i manage cashfree payment and epubviewer both in app, because when i use cashfree payment then again epubviewer crash?

Share full log here.

rachnayeSangeeta commented 2 years ago

remove other payment gateway packages, if used any.

@bhoominn How i manage cashfree payment and epubviewer both in app, because when i use cashfree payment then again epubviewer crash?

Share full log here.

I/opening ( 8294): In open function I/sink status( 8294): sink is empty I/flutter ( 8294): In stream W/Java7Support( 8294): Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added I/SavedLocation( 8294): -> savedLocation -> {"bookId":"1c13f9b8-9bb7-43d5-955f-ebf8f073d27e","href":"/OEBPS/ch06.xhtml","created":1539934158390,"locations":{"cfi":"epubcfi(/0!/4/724/7:0)"}} I/Timeline( 8294): Timeline: Activity_launch_request time:2836431690 W/ActivityThread( 8294): handleWindowVisibility: no activity for token android.os.BinderProxy@be4362c V/FolioActivity( 8294): -> initDistractionFreeMode D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 V/FolioActivity( 8294): -> hideSystemUI V/FolioActivity( 8294): -> showSystemUI D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 I/chatty ( 8294): uid=10596(com.dev.rachnaye) identical 1 line D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 W/om.dev.rachnay( 8294): Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed) W/om.dev.rachnay( 8294): Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed) D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 V/FolioActivity( 8294): -> setNightMode V/FolioActivity( 8294): -> initMediaController V/FolioActivity( 8294): -> setupBook V/FolioActivity( 8294): -> initBook D/AppUtil ( 8294): -> getAvailablePortNumber -> portNumber 8080 available W/Activity( 8294): Slow Operation: Activity com.dev.rachnaye/com.folioreader.ui.activity.FolioActivity onCreate took 797ms V/FolioActivity( 8294): -> onPostCreate V/FolioActivity( 8294): -> onResume W/Looper ( 8294): Slow Looper main: Activity com.dev.rachnaye/com.folioreader.ui.activity.FolioActivity is 925ms late (wall=0ms running=0ms ClientTransaction{ callbacks=[android.app.servertransaction.TopResumedActivityChangeItem] }) because of 1 msg, msg 1 took 924ms (seq=177 running=721ms runnable=48ms io=81ms late=1ms h=android.app.ActivityThread$H w=159) I/Choreographer( 8294): Skipped 55 frames! The application may be doing too much work on its main thread. V/FolioAppBarLayout( 8294): -> onApplyWindowInsets I/TextToSpeech( 8294): Sucessfully bound to com.google.android.tts D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 I/chatty ( 8294): uid=10596(com.dev.rachnaye) identical 1 line D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 I/WebViewFactory( 8294): Loading com.google.android.webview version 84.0.4147.111 (code 414711183) I/cr_LibraryLoader( 8294): Loaded native library version number "84.0.4147.111" I/cr_CachingUmaRecorder( 8294): Flushed 5 samples from 5 histograms. D/EgretLoader( 8294): EgretLoader(Context context) D/EgretLoader( 8294): The context is not activity D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 I/chatty ( 8294): uid=10596(com.dev.rachnaye) identical 1 line D/ForceDarkHelper( 8294): updateByCheckExcludeList: pkg: com.dev.rachnaye activity: com.folioreader.ui.activity.FolioActivity@4c2b965 V/FolioWebView( 8294): -> init V/FolioWebView( 8294): -> initViewTextSelection D/AndroidRuntime( 8294): Shutting down VM E/AndroidRuntime( 8294): FATAL EXCEPTION: main E/AndroidRuntime( 8294): Process: com.dev.rachnaye, PID: 8294 E/AndroidRuntime( 8294): java.lang.NoSuchFieldError: No static field abc_text_select_handle_middle_mtrl_dark of type I in class Lcom/folioreader/R$drawable; or its superclasses (declaration of 'com.folioreader.R$drawable' appears in /data/app/com.dev.rachnaye-LY2F51-QdV580-SG4XaP5g==/base.apk!classes2.dex) E/AndroidRuntime( 8294): at com.folioreader.ui.view.FolioWebView.initViewTextSelection(FolioWebView.kt:287) E/AndroidRuntime( 8294): at com.folioreader.ui.view.FolioWebView.init(FolioWebView.kt:279) E/AndroidRuntime( 8294): at com.folioreader.ui.view.FolioWebView.setFolioActivityCallback(FolioWebView.kt:411) E/AndroidRuntime( 8294): at com.folioreader.ui.fragment.FolioPageFragment.initWebView(FolioPageFragment.kt:375) E/AndroidRuntime( 8294): at com.folioreader.ui.fragment.FolioPageFragment.onCreateView(FolioPageFragment.kt:183) E/AndroidRuntime( 8294): at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2935) E/AndroidRuntime( 8294): at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:539) E/AndroidRuntime( 8294): at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:276) E/AndroidRuntime( 8294): at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112) E/AndroidRuntime( 8294): at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1632) E/AndroidRuntime( 8294): at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:455) E/AndroidRuntime( 8294): at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2389) E/AndroidRuntime( 8294): at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2145) E/AndroidRuntime( 8294): at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2083) E/AndroidRuntime( 8294): at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1954) E/AndroidRuntime( 8294): at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:306) E/AndroidRuntime( 8294): at androidx.fragment.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:274) E/AndroidRuntime( 8294): at com.folioreader.ui.view.DirectionalViewpager.populate(DirectionalViewpager.java:1327) E/AndroidRuntime( 8294): at com.folioreader.ui.view.DirectionalViewpager.populate(DirectionalViewpager.java:1105) E/AndroidRuntime( 8294): at com.folioreader.ui.view.DirectionalViewpager.onMeasure(DirectionalViewpager.java:1828) E/AndroidRuntime( 8294): at android.view.View.measure(View.java:24862) E/AndroidRuntime( 8294): at androidx.constraintlayout.widget.ConstraintLayout$Measurer.measure(ConstraintLayout.java:763) E/AndroidRuntime( 8294): at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.measure(BasicMeasure.java:426) E/AndroidRuntime( 8294): at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.solverMeasure(BasicMeasure.java:335) E/AndroidRuntime( 8294): at androidx.constraintlayout.solver.widgets.ConstraintWidgetContainer.measure(ConstraintWidgetContainer.java:117) E/AndroidRuntime( 8294): at androidx.constraintlayout.widget.ConstraintLayout.resolveSystem(ConstraintLayout.java:1532) E/AndroidRuntime( 8294): at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1607) E/AndroidRuntime( 8294): at android.view.View.measure(View.java:24862) E/AndroidRuntime( 8294): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6893) E/AndroidRuntime( 8294): at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) E/AndroidRuntime( 8294): at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145) E/AndroidRuntime( 8294): at android.view.View.measure(View.java:24862) E/AndroidRuntime( 8294): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6893) E/AndroidRuntime( 8294): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552) E/AndroidRuntime( 8294): at android.widget.LinearLayout.measureVertical(LinearLayout.java:842) E/AndroidRuntime( 8294): at android.widget.LinearLayout.onMeasure(LinearLayout.java:721) E/AndroidRuntime( 8294): at android.view.View.measure(View.java:24862) E/AndroidRuntime( 8294): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6893) E/AndroidRuntime( 8294): at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) E/AndroidRuntime( 8294): at android.view.View.measure(View.java:24862) E/AndroidRuntime( 8294): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6893) E/AndroidRuntime( 8294): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552) E/AndroidRuntime( 8294): at android.widget.LinearLayout.measureVertical(LinearLayout.java:842) E/AndroidRuntime( 8294): at android.widget.LinearLayout.onMeasure(LinearLayout.java:721) E/AndroidRuntime( 8294): at android.view.View.measure(View.java:24862) E/AndroidRuntime( 8294): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6893) E/AndroidRuntime( 8294): at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) E/AndroidRuntime( 8294): at com.android.internal.policy.DecorView.onMeasure(DecorView.java:775) E/AndroidRuntime( 8294): at android.view.View.measure(View.java:24862) E/AndroidRuntime( 8294): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3119) E/AndroidRuntime( 8294): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1931) E/AndroidRuntime( 8294): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2225) E/AndroidRuntime( 8294): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1819) E/AndroidRuntime( 8294): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7783) E/AndroidRuntime( 8294): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1058) E/AndroidRuntime( 8294): at android.view.Choreographer.doCallbacks(Choreographer.java:865) E/AndroidRuntime( 8294): at android.view.Choreographer.doFrame(Choreographer.java:800) E/AndroidRuntime( 8294): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043) E/AndroidRuntime( 8294): at android.os.Handler.handleCallback(Handler.java:883) E/AndroidRuntime( 8294): at android.os.Handler.dispatchMessage(Handler.java:100) E/AndroidRuntime( 8294): at android.os.Looper.loop(Looper.java:224) E/AndroidRuntime( 8294): at android.app.ActivityThread.main(ActivityThread.java:7562) E/AndroidRuntime( 8294): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 8294): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) E/AndroidRuntime( 8294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) I/Process ( 8294): Sending signal. PID: 8294 SIG: 9 Lost connection to device.

rachnayeSangeeta commented 2 years ago

Hi, I'm trying to disable screenshot inside epubviewer, but bad luck, Can somebody help me out please?

kartik-techtonic commented 2 years ago

Hi, I'm trying to disable screenshot inside epubviewer, but bad luck, Can somebody help me out please?

Have you figured out your previous error's solution which you posted earlier?

Tahaylmz commented 2 years ago

I'm getting this error too, is there a solution?

kartik-techtonic commented 2 years ago

Still facing the same issue. Haven't got any solution yet.

Can you tell me in case you find one?

On Mon, May 9, 2022, 3:26 PM Taha Yilmaz @.***> wrote:

I'm getting this error too, is there a solution?

— Reply to this email directly, view it on GitHub https://github.com/FolioReader/FolioReader-Android/issues/501#issuecomment-1120893019, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYQGMJHHDB3TLXHUL4UWN6LVJDONJANCNFSM47DDU3SQ . You are receiving this because you commented.Message ID: @.***>

Tahaylmz commented 2 years ago

Yes, sure.

Still facing the same issue. Haven't got any solution yet. Can you tell me in case you find one? On Mon, May 9, 2022, 3:26 PM Taha Yilmaz @.> wrote: I'm getting this error too, is there a solution? — Reply to this email directly, view it on GitHub <#501 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYQGMJHHDB3TLXHUL4UWN6LVJDONJANCNFSM47DDU3SQ . You are receiving this because you commented.Message ID: @.>

Tahaylmz commented 2 years ago

Hey @kartik-techtonic,

I think i found the problem. Application crashes when release build. If the app is in release mode (not debug mode) crashes. I don't know how to solve this but I tried the solutions in the package, it doesn't work.

kartik-techtonic commented 2 years ago

First time my app runs it downloads the epub file and then it opens the Folioreader but does not show epub content and then after 3-4seconds app just returns to homepage. And then after tapping on the ebook again it just crashes.

On Mon, May 9, 2022, 6:10 PM Taha Yilmaz @.***> wrote:

Hey @kartik-techtonic https://github.com/kartik-techtonic,

I think i found the problem. Application crashes when release build. If the app is in release mode (not debug mode) crashes. I don't know how to solve this but I tried the solutions in the package, it doesn't work.

— Reply to this email directly, view it on GitHub https://github.com/FolioReader/FolioReader-Android/issues/501#issuecomment-1121047147, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYQGMJFYMNRXRTZPZ7EAOGLVJEBTXANCNFSM47DDU3SQ . You are receiving this because you were mentioned.Message ID: @.***>

Tahaylmz commented 2 years ago

Here is the solution in the package; buildTypes { release { minifyEnabled false shrinkResources false signingConfig signingConfigs.release }

But it doesn't work..

TSoftwareLimited commented 2 years ago

Screenshot_20220703-105536 How to solve this error please.... Android 11

Tahaylmz commented 1 year ago

https://stackoverflow.com/questions/72228668/epub-viewer-package-release-build-crash/72290447#72290447