InflationX/ViewPump

IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull

YPoudanenOnSeo opened this issue · 3 comments

There are crash when ViewPupm try to inflate layout.

Device: Samsung Galaxy S7
OS: Android 7.0
Library version: 2.0.0
Main project language : Java

Caused by java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter parent at io.github.inflationx.viewpump.ViewPumpLayoutInflater.onCreateView(ViewPumpLayoutInflater.kt) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:792) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734) at android.view.LayoutInflater.inflate(LayoutInflater.java:496) at io.github.inflationx.viewpump.ViewPumpLayoutInflater.inflate(ViewPumpLayoutInflater.kt:54) at android.view.LayoutInflater.inflate(LayoutInflater.java:427) at io.github.inflationx.viewpump.ViewPumpLayoutInflater.inflate(ViewPumpLayoutInflater.kt:45) at android.view.LayoutInflater.inflate(LayoutInflater.java:378) at com.android.internal.policy.DecorView.onResourcesLoaded(DecorView.java:2297) at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:2784) at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2857) at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2167) at android.support.v7.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:575) at android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518) at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:466) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.livescore.ui.activities.BaseActivity.onCreate(BaseActivity.java:188) at com.livescore.ui.activities.HomeActivity.onCreate(HomeActivity.java:31) at com.livescore.ui.activities.soccer.SoccerHomeActivity.onCreate(SoccerHomeActivity.java:17) at android.app.Activity.performCreate(Activity.java:6942) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6682) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

Also is seem that it cant inflate LinearLayout:

Caused by android.view.InflateException: Binary XML file line #24: Error inflating class LinearLayout

Code which I use:

    ViewPump.init(ViewPump.builder()
            .addInterceptor(chain -> {
                InflateResult result = chain.proceed(chain.request());
                if (result.view() instanceof TextView) {
                    TextView textView = (TextView) result.view();
                    textView.setTypeface(ResourcesCompat.getFont(LiveScoreApplication.this, R.font.roboto_black));
                }
                return result;
            }).build());

Same hit

@YPoudanenOnSeo v1.0.0 is not infected with this bug. If you're in urgent, try that version.

This is a duplicate of #28. The issue was caused by #24. This will get addressed in the next release after #27 is merged. You can continue to use 1.0.0 until then since the functionality is the same.