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

Error using ColorPicker #5

Closed
Javierenrique00 opened this issue Apr 14, 2020 · 8 comments
Closed

Error using ColorPicker #5

Javierenrique00 opened this issue Apr 14, 2020 · 8 comments

Comments

@Javierenrique00
Copy link

Javierenrique00 commented Apr 14, 2020

Hello I was trying to use the ColorPicker, but when the app is running and the Dialog is opening the app crash with the following error:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: xxxx.xxxxxx.xxxx.xxxx, PID: 4848
android.view.InflateException: Binary XML file line #20: Binary XML file line #20: Error inflating class com.google.android.material.card.MaterialCardView
Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class com.google.android.material.card.MaterialCardView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.github.dhaval2404.colorpicker.ColorPickerDialog.show(ColorPickerDialog.kt:202)
at com.github.dhaval2404.colorpicker.ColorPickerDialog$Builder.show(ColorPickerDialog.kt:186)
at com.mundocrativo.javier.twitter.ui.design.DesignFragment.showColorPicker(DesignFragment.kt:47)
at com.mundocrativo.javier.twitter.ui.design.DesignFragment$onCreateView$1.onClick(DesignFragment.kt:25)

It looks that there are a dependency that is not compatible. I´m opening a newproject in android studio and the only dependency that I use is this color picker.

I´m using Android Studio 3.5.

This is the dependencies in the gradle file:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'

    implementation 'com.github.dhaval2404:colorpicker:1.1'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
@marcauberer
Copy link
Contributor

marcauberer commented Apr 14, 2020

Oh. This issue sounds familiar to me ...
You can try to use a theme for your activity, inheriting from Theme.MaterialComponents e.g.: Theme.MaterialComponents.DayNight.NoActionBar. This should help

@marcauberer
Copy link
Contributor

And try to add this dependency:
implementation 'com.google.android.material:material:1.1.0'

@Javierenrique00
Copy link
Author

Javierenrique00 commented Apr 14, 2020 via email

@Javierenrique00
Copy link
Author

I close the issue, but I think that in the documentation is necessary to take into account the components needed.

@Maulikpatel2492
Copy link

duanhong169/ColorPicker#7 (comment)

is solved

Thanks

@Maulikpatel2492
Copy link

How to set default progress bar CENTER on ANDROID programmatically

final ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setIndeterminate(true);
try {
progressDialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.without_mask_logo, null));
progressDialog.show();
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(100,100);
} catch (Exception e) {
e.printStackTrace();
}

@iqtoon
Copy link

iqtoon commented May 18, 2022

i have the same issue i tried to change theme to "Theme.MaterialComponents.DayNight.NoActionBar" and "implementation 'com.google.android.material:material:1.1.0'" and nothing still not working :(

1 similar comment
@iqtoon
Copy link

iqtoon commented May 18, 2022

i have the same issue i tried to change theme to "Theme.MaterialComponents.DayNight.NoActionBar" and "implementation 'com.google.android.material:material:1.1.0'" and nothing still not working :(

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

4 participants