Я получаю фатальное исключение: java.lang.RuntimeException в BubbleMessageView.kt (строка 64) из библиотеки Android BubbleShowCase - PullRequest
0 голосов
/ 03 октября 2019

Я использую библиотеку BubbleShowCase для реализации show case в моем приложении для Android. Чтобы витрина появилась в моей Деятельности, я вызываю следующий метод в методе Активности onResume ().

private fun learnShowcaseHints() {
val bubbleShowCaseBuilder1 = BubbleShowCaseBuilder(this)
    .description(getString(R.string.hint1))
    .backgroundColorResourceId(R.color.color_primary_dark)
    .textColorResourceId(R.color.color_text)
    .showOnce(BUBBLE_SHOW_CASE_ID1) // Id to show only once the BubbleShowCase
    .listener(object : BubbleShowCaseListener{
        override fun onTargetClick(bubbleShowCase: BubbleShowCase) {
            // Called when the user clicks the target
        }
        override fun onCloseActionImageClick(bubbleShowCase: BubbleShowCase) {
            // Called when the user clicks the close button
        }
        override fun onBackgroundDimClick(bubbleShowCase: BubbleShowCase) {
            // Called when the user clicks on the background dim
        }
        override fun onBubbleClick(bubbleShowCase: BubbleShowCase) {
            // Called when the user clicks on the bubble
            bubbleShowCase.dismiss()
        }
    })

val bubbleShowCaseBuilder2 = BubbleShowCaseBuilder(this)
    .description(getString(R.string.hint2))
    .backgroundColorResourceId(R.color.color_primary_dark)
    .textColorResourceId(R.color.color_text)
    .targetView(showCaseImageButton)
    .showOnce(BUBBLE_SHOW_CASE_ID2) // Id to show only once the BubbleShowCase
    .listener(object : BubbleShowCaseListener{
        override fun onTargetClick(bubbleShowCase: BubbleShowCase) {
            // Called when the user clicks the target
        }
        override fun onBackgroundDimClick(bubbleShowCase: BubbleShowCase) {
            // Called when the user clicks on the background dim
        }
        override fun onCloseActionImageClick(bubbleShowCase: BubbleShowCase) {
            // Called when the user clicks the close button
        }
        override fun onBubbleClick(bubbleShowCase: BubbleShowCase) {
            // Called when the user clicks on the bubble
            bubbleShowCase.dismiss()
        }
    })

BubbleShowCaseSequence()
    .addShowCase(bubbleShowCaseBuilder1)
    .addShowCase(bubbleShowCaseBuilder2)
    .show()

}

Я получаю некоторые отчеты о сбоях при сбое, Я не могу воспроизвести .

Это трассировка стека, которую я получаю:

Fatal Exception: java.lang.RuntimeException: Unable to resume activity {LearnActivity}: android.view.InflateException: Binary XML file line #63: Binary XML file line #63: Error inflating class ImageView
   at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4026)
   at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4058)
   at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
   at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
   at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1960)
   at android.os.Handler.dispatchMessage(Handler.java:106)
   at android.os.Looper.loop(Looper.java:214)
   at android.app.ActivityThread.main(ActivityThread.java:7081)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

Я также получаю эту трассировку стека, которая может помочь вам понять:

Caused by android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f07013c
at android.content.res.ResourcesImpl.getResourceName(ResourcesImpl.java:267)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:831)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:677)
at android.content.res.Resources.loadDrawable(Resources.java:912)
at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:955)
at android.content.res.TypedArray.getDrawable(TypedArray.java:930)
at android.widget.ImageView.(ImageView.java:189)
at android.widget.ImageView.(ImageView.java:172)
at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java:72)
at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java:68)
at androidx.appcompat.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:182)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:811)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:769)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:902)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:863)
at android.view.LayoutInflater.inflate(LayoutInflater.java:554)
at android.view.LayoutInflater.inflate(LayoutInflater.java:461)
at android.view.LayoutInflater.inflate(LayoutInflater.java:383)
at android.view.View.inflate(View.java:26183)
at com.elconfidencial.bubbleshowcase.BubbleMessageView.inflateXML(BubbleMessageView.kt:64)
at com.elconfidencial.bubbleshowcase.BubbleMessageView.initView(BubbleMessageView.kt:59)
at com.elconfidencial.bubbleshowcase.BubbleMessageView.(BubbleMessageView.kt:47)
at com.elconfidencial.bubbleshowcase.BubbleMessageView$Builder.build(BubbleMessageView.kt:323)
at com.elconfidencial.bubbleshowcase.BubbleShowCase.addBubbleMessageViewOnScreenCenter(BubbleShowCase.kt:327)
at com.elconfidencial.bubbleshowcase.BubbleShowCase.show(BubbleShowCase.kt:115)
at com.elconfidencial.bubbleshowcase.BubbleShowCaseBuilder.show(BubbleShowCaseBuilder.kt:278)
at com.elconfidencial.bubbleshowcase.BubbleShowCaseSequence.show(BubbleShowCaseSequence.kt:47)
at com.elconfidencial.bubbleshowcase.BubbleShowCaseSequence.show(BubbleShowCaseSequence.kt:23)
at LearnActivity.learnShowcaseHints(LearnActivity.kt:99)
at LearnActivity.onResume(LearnActivity.kt:49)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1416)
at android.app.Activity.performResume(Activity.java:7585)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4018)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4058)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1960)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7081)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

Кто-нибудь из вас тоже имеет это исключение?

Это ошибка библиотеки или я что-то не так делаю? Если да, есть идеи как это исправить?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...