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

I get android.content.res.Resources$NotFoundException. How can I solve this? #52

Open
EcemMineOz opened this issue Jul 20, 2020 · 4 comments

Comments

@EcemMineOz
Copy link

I use version 3.1.1.

Caused by android.content.res.Resources$NotFoundException
Unable to find resource ID #0x7f090543
android.content.res.ResourcesImpl.getResourceEntryName (ResourcesImpl.java:289)
android.content.res.Resources.getResourceEntryName (Resources.java:1996)
io.github.inflationx.calligraphy3.Calligraphy.matchesResourceIdName (Calligraphy.java:94)
io.github.inflationx.calligraphy3.Calligraphy.isActionBarTitle (Calligraphy.java:57)
io.github.inflationx.calligraphy3.Calligraphy.getStyleForTextView (Calligraphy.java:33)
io.github.inflationx.calligraphy3.Calligraphy.onViewCreatedInternal (Calligraphy.java:139)
io.github.inflationx.calligraphy3.Calligraphy.onViewCreated (Calligraphy.java:117)
io.github.inflationx.calligraphy3.CalligraphyInterceptor.intercept (CalligraphyInterceptor.java:19)
io.github.inflationx.viewpump.internal.-InterceptorChain.proceed (-InterceptorChain.java:30)
io.github.inflationx.viewpump.ViewPump.inflate (ViewPump.java:36)
io.github.inflationx.viewpump.internal.-ViewPumpLayoutInflater$WrapperFactory2.onCreateView (-ViewPumpLayoutInflater.java:358)
android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:772)

@chrisjenx
Copy link
Member

If you haven't already try updating to ViewPump 2.0.3

@Girish-Setti
Copy link

still having the issue @chrisjenx

@chrisjenx
Copy link
Member

Phone, xml, version, etc

@Petr-Kubista
Copy link

I also encountered this issue. I have multiple build flavours. The missing resource is a drawable, which I have the source for in the main res directory for the 5 standard screen density options. Then it is referenced in drawables.xml in the main resources directory: <item name="welcome_background" type="drawable">@drawable/xx_welcome_background</item> and used in a layout which crashes.

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/welcome_background" />

The project is using the following versions:

implementation "io.github.inflationx:calligraphy3:3.1.1"
implementation 'io.github.inflationx:viewpump:2.1.1'

I got the reports from Firebase Crashlytics for various devices with Android ranging from 12, through 10 to 8.1, devices like Google Nexus 5X, Xiaomi, Huawei

The code that crashes is an extension of CalligraphyInterceptor:

    @Override
    public InflateResult intercept(Chain chain) {
        try {
            InflateResult result = chain.proceed(chain.request());
            View view = result.view();

            if (
                    view instanceof CustomFontTextView
                            || view instanceof CustomFontButton
                            || view instanceof CustomFontToolbar
                            || view instanceof RelativeTimeTextView
                            || view instanceof ExpandableTextView
            ) {
                return result.toBuilder().build();
            }
        } catch (RuntimeException e) {
            Timber.w(e, "Unable to use custom font through CalligraphyInterceptor");
        }

        return super.intercept(chain);
    }

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