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

hitting InflateException error when using in androidX project #1074

Open
vajjasivateja opened this issue Nov 5, 2020 · 3 comments
Open

hitting InflateException error when using in androidX project #1074

vajjasivateja opened this issue Nov 5, 2020 · 3 comments

Comments

@vajjasivateja
Copy link

I am unable to use this library in androidX project.

I have enabled enableJetifier
android.useAndroidX=true

Automatically convert third-party libraries to use AndroidX

android.enableJetifier=true
and also using classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta10' in project gradle dependency.

android.view.InflateException: Binary XML file line #34 in layout/activity_main: Binary XML file line #34 in layout/activity_main: Error inflating class com.prolificinteractive.materialcalendarview.MaterialCalendarView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
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:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
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)
Caused by: android.view.InflateException: Binary XML file line #34 in com.android.app.slate.debug:layout/activity_splash_screen: Binary XML file line #34 in com.android.app.slate.debug:layout/activity_splash_screen: Error inflating class com.prolificinteractive.materialcalendarview.MaterialCalendarView
Caused by: android.view.InflateException: Binary XML file line #34 in com.android.app.slate.debug:layout/activity_splash_screen: Error inflating class com.prolificinteractive.materialcalendarview.MaterialCalendarView
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:854)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
at com.android.app.slate.introduction.SplashScreenActivity.onCreate(SplashScreenActivity.kt:26)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
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:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
2020-11-05 08:24:37.671 2907-2907/com.android.app.slate.debug E/AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
at com.prolificinteractive.materialcalendarview.MaterialCalendarView.(MaterialCalendarView.java:272)
... 30 more

Please some one help me with this

@vajjasivateja vajjasivateja changed the title hitting this error when using in androidX project hitting InflateException error when using in androidX project Nov 5, 2020
@miljanpavlovic
Copy link

Hi, +1 for this issue, I hit this exception today.

@MalcolmMcFly
Copy link

Seeing this error as well

@blueokanna
Copy link

It is the same problem here, I guess that may need to change the content_view for the show. (Component).setOnClickListener(new View.OnClickListener(){......

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