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

Adapty_flutter and epub_viewer can't work together #50

Closed
Tahaylmz opened this issue May 16, 2022 · 3 comments
Closed

Adapty_flutter and epub_viewer can't work together #50

Tahaylmz opened this issue May 16, 2022 · 3 comments

Comments

@Tahaylmz
Copy link

Hi,

I was getting an error for a while in my app. At the end, I was trying to understand the cause of the error by removing the packages I used one by one. I finally found the reason for the crash. After removing the adapty_flutter package, I realized that there is no problem. There is obviously a conflict in the adapty_flutter package and the epub_viewer package. I'm open to any helpful information.

The error message i got:
E/AndroidRuntime( 1638): 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/~~wsrkl0h87yoxUbPWj-P6Wg==/com.example.upubselfdemo-Tvu7HpZFMAKRbrLx2LFhLA==/base.apk!classes2.dex) E/AndroidRuntime( 1638): at com.folioreader.ui.view.FolioWebView.initViewTextSelection(FolioWebView.kt:287) E/AndroidRuntime( 1638): at com.folioreader.ui.view.FolioWebView.init(FolioWebView.kt:279) E/AndroidRuntime( 1638): at com.folioreader.ui.view.FolioWebView.setFolioActivityCallback(FolioWebView.kt:411) E/AndroidRuntime( 1638): at com.folioreader.ui.fragment.FolioPageFragment.initWebView(FolioPageFragment.kt:375) E/AndroidRuntime( 1638): at com.folioreader.ui.fragment.FolioPageFragment.onCreateView(FolioPageFragment.kt:183) E/AndroidRuntime( 1638): at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963) E/AndroidRuntime( 1638): at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518) E/AndroidRuntime( 1638): at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282) E/AndroidRuntime( 1638): at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189) E/AndroidRuntime( 1638): at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100) E/AndroidRuntime( 1638): at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1971) E/AndroidRuntime( 1638): at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:311) E/AndroidRuntime( 1638): at androidx.fragment.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:274) E/AndroidRuntime( 1638): at com.folioreader.ui.view.DirectionalViewpager.populate(DirectionalViewpager.java:1327) E/AndroidRuntime( 1638): at com.folioreader.ui.view.DirectionalViewpager.populate(DirectionalViewpager.java:1105) E/AndroidRuntime( 1638): at com.folioreader.ui.view.DirectionalViewpager.onMeasure(DirectionalViewpager.java:1828) E/AndroidRuntime( 1638): at android.view.View.measure(View.java:25466) E/AndroidRuntime( 1638): at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1676) E/AndroidRuntime( 1638): at android.view.View.measure(View.java:25466) E/AndroidRuntime( 1638): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957) E/AndroidRuntime( 1638): at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) E/AndroidRuntime( 1638): at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145) E/AndroidRuntime( 1638): at android.view.View.measure(View.java:25466) E/AndroidRuntime( 1638): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957) E/AndroidRuntime( 1638): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552) E/AndroidRuntime( 1638): at android.widget.LinearLayout.measureVertical(LinearLayout.java:842) E/AndroidRuntime( 1638): at android.widget.LinearLayout.onMeasure(LinearLayout.java:721) E/AndroidRuntime( 1638): at android.view.View.measure(View.java:25466) E/AndroidRuntime( 1638): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)

@vladd-g
Copy link
Collaborator

vladd-g commented May 16, 2022

Hi @Tahaylmz

I think this is the solution. You can put the images in your res/drawable folders in Android Studio (don't forget to choose the correct modifier when pasting - -mdpi, -hdpi, etc. - and the name "abc_text_select_handle_middle_mtrl_dark" so that they override those absent resources)

Or maybe some other suggestions from the comments will help

@vladd-g
Copy link
Collaborator

vladd-g commented May 16, 2022

@Tahaylmz alternatively you can try to do the following.

Please find your build.gradle file corresponding to this (your app's build.gradle file on the main module level), and below the anchored line add this code:

implementation('androidx.appcompat:appcompat') {
    version {
        strictly '1.2.0'
    }
}
implementation 'androidx.core:core:1.5.0'

But if you do, please don't forget to test that nothing else breaks

@Tahaylmz
Copy link
Author

Second method solved my problem thank you so much :)
Have a good day.

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