我正在尝试将Hijri日历添加到我的Android应用程序中。我在Github HIJRI CALENDARE上获得了这个资源,因为它说我添加了两个依赖项和我的Activity中的XML完全相同所有工作正常!
但是当我的应用程序启动时,我收到一个错误,我不知道它是什么!
继承我的日志:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mon.muslim/com.example.mon.muslim.Map}: android.view.InflateException: Binary XML file line #9: Error inflating class com.github.eltohamy.materialhijricalendarview.MaterialHijriCalendarView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2699)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2773)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1434)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5930)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class com.github.eltohamy.materialhijricalendarview.MaterialHijriCalendarView
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.example.mon.muslim.Map.onCreate(Map.java:18)
at android.app.Activity.performCreate(Activity.java:6178)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2652)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2773)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1434)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5930)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.example.mon.muslim.Map.onCreate(Map.java:18)
at android.app.Activity.performCreate(Activity.java:6178)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2652)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2773)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1434)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5930)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
Caused by: java.util.MissingResourceException: Can't find resource for bundle 'com.github.msarhan.ummalqura.calendar.text.UmmalquraFormatData_fr_FR', key ''
at java.util.ResourceBundle.missingResourceException(ResourceBundle.java:238)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:230)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:159)
at com.github.msarhan.ummalqura.calendar.UmmalquraDateFormatSymbols.initializeData(UmmalquraDateFormatSymbols.java:91)
at com.github.msarhan.ummalqura.calendar.UmmalquraDateFormatSymbols.(UmmalquraDateFormatSymbols.java:66)
at com.github.msarhan.ummalqura.calendar.UmmalquraCalendar.getDisplayName(UmmalquraCalendar.java:325)
at com.github.eltohamy.materialhijricalendarview.format.DateFormatTitleFormatter.format(DateFormatTitleFormatter.java:42)
at com.github.eltohamy.materialhijricalendarview.TitleChanger.doChange(TitleChanger.java:68)
at com.github.eltohamy.materialhijricalendarview.TitleChanger.change(TitleChanger.java:51)
at com.github.eltohamy.materialhijricalendarview.MaterialHijriCalendarView.updateUi(MaterialHijriCalendarView.java:373)
at com.github.eltohamy.materialhijricalendarview.MaterialHijriCalendarView.access$600(MaterialHijriCalendarView.java:67)
at com.github.eltohamy.materialhijricalendarview.MaterialHijriCalendarView$2.onPageSelected(MaterialHijriCalendarView.java:184)
at android.support.v4.view.ViewPager.dispatchOnPageSelected(ViewPager.java:1935)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:659)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:625)
at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:617)
at com.git
有人可以帮助我吗?
答案 0 :(得分:1)
在您的错误日志中明确提到
android.view.InflateException:二进制XML文件行
和原因是:
让类膨胀错误 com.github.eltohamy.materialhijricalendarview.MaterialHijriCalendarView
这意味着系统无法找到您的 MaterialHijriCalendarView 类
请确保您已将此依赖项添加到gradle文件中。
1)实现'com.github.eltohamy:material-hijri-calendarview:1.1.1'到您的依赖项。
2)添加实施组:'com.github.msarhan',名称:'ummalqura-calendar', 版本:'1.1.7'到您的依赖项