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

Crash if no databinding enabled in project #24

Open
Dimezis opened this issue Jan 7, 2021 · 2 comments
Open

Crash if no databinding enabled in project #24

Dimezis opened this issue Jan 7, 2021 · 2 comments

Comments

@Dimezis
Copy link

Dimezis commented Jan 7, 2021

Crash when starting Croppy if the project doesn't have databinding added in gradle.

Croppy.start(this, CropRequest.Auto(bitmapUri, code))
FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/databinding/DataBinderMapperImpl;
        at androidx.databinding.DataBindingUtil.<clinit>(DataBindingUtil.java:32)
        at androidx.databinding.DataBindingUtil.setContentView(DataBindingUtil.java:284)
        at com.lyrebirdstudio.croppylib.main.CroppyActivity.onCreate(CroppyActivity.kt:23)
        at android.app.Activity.performCreate(Activity.java:7963)
        at android.app.Activity.performCreate(Activity.java:7952)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3629)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3806)
        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:2267)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8167)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
@HaXxanParhar
Copy link

I faced the same issue so ended up enabling the data binding by adding the following:

buildFeatures {
dataBinding true
}

Do you have a specific reason for not adding the data binding?

@Dimezis
Copy link
Author

Dimezis commented Jan 21, 2022

Do you have a specific reason for not adding the data binding?

Well, if data binding is not used in the project, why force it?
It would affect build times and add unnecessary dependencies

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