How i solve the error in fragment with android nav component - android

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.farmbuy/com.farmbuy.farmer.FarmersActivity}: android.view.InflateException: Binary XML file line #49: Binary XML file line #49: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
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(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: android.view.InflateException: Binary XML file line #49: Binary XML file line #49: Error inflating class fragment
Caused by: android.view.InflateException: Binary XML file line #49: Error inflating class fragment
Caused by: java.lang.IllegalStateException: no start destination defined via app:startDestination for com.farmbuy:id/farmer_nav_graph
at androidx.navigation.NavGraphNavigator.navigate(NavGraphNavigator.java:61)
at androidx.navigation.NavGraphNavigator.navigate(NavGraphNavigator.java:28)
at androidx.navigation.NavController.navigate(NavController.java:1049)
at androidx.navigation.NavController.onGraphCreated(NavController.java:633)
at androidx.navigation.NavController.setGraph(NavController.java:586)
at androidx.navigation.NavController.setGraph(NavController.java:551)
at androidx.navigation.NavController.setGraph(NavController.java:533)
at androidx.navigation.fragment.NavHostFragment.onCreate(NavHostFragment.java:238)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2684)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:280)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1175)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356)
at androidx.fragment.app.FragmentLayoutInflaterFactory.onCreateView(FragmentLayoutInflaterFactory.java:109)
at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:135)
at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:356)
at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:335)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:784)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:865)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.inflate(LayoutInflater.java:525)
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
at android.view.LayoutInflater.inflate(LayoutInflater.java:378)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
at com.farmbuy.farmer.FarmersActivity.onCreate(FarmersActivity.kt:13)
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(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

Looks like you have not spcified a start destination in your nav graph. There must be one start destination which is the fragment that you want to show to the user when user launches the app.
Add this in your navigation graph app:startDestination="#id/fragmentId. Here fragmentId is the id of the fragment which should show when app is first launched

I solved this by adding the start destination in the nav_graph
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/farmer_nav_graph"
app:startDestination="#id/farmersProductsFragment
>

Related

App crashes on some devices because InflateException: #19: Error inflating class ImageView or "requestFeature() must be called before adding content"

App crashes on some devices because of layout issues.
Now only VIVO Y66 (Android 6.0.1, API 23) crashes.
If the fragment contains image, it will get InflateException error:
android.view.InflateException: Binary XML file line #19: Binary XML file line #19: Error inflating class ImageView
at android.view.LayoutInflater.inflate(LayoutInflater.java:545)
at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
at com.abacus.newonlineordering.view.fragment.RoyaltyPointsFragment.onCreateView(RoyaltyPointsFragment.java:87)
at android.app.Fragment.performCreateView(Fragment.java:2220)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
at android.app.BackStackRecord.run(BackStackRecord.java:793)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:482)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5619)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:737)
Caused by: android.view.InflateException: Binary XML file line #19: Error inflating class ImageView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:827)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:749)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:880)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:843)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:883)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:843)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:883)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:843)
at android.view.LayoutInflater.inflate(LayoutInflater.java:521)
at android.view.LayoutInflater.inflate(LayoutInflater.java:429) 
at com.abacus.newonlineordering.view.fragment.RoyaltyPointsFragment.onCreateView(RoyaltyPointsFragment.java:87) 
at android.app.Fragment.performCreateView(Fragment.java:2220) 
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973) 
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148) 
at android.app.BackStackRecord.run(BackStackRecord.java:793) 
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535) 
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:482) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5619) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:737) 
Caused by: android.content.res.Resources$NotFoundException: Resource "com.abacus.newonlineordering:drawable/barcode" (7f070061) is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f070061 a=-1 r=0x7f070061}
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2668)
at android.content.res.Resources.loadDrawable(Resources.java:2606)
at android.content.res.VivoResources.loadDrawable(VivoResources.java:220)
at android.content.res.TypedArray.getDrawable(TypedArray.java:870)
at android.widget.ImageView.<init>(ImageView.java:152)
at android.widget.ImageView.<init>(ImageView.java:140)
at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:71)
at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:67)
at android.support.v7.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:181)
at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:105)
at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1035)
at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1092)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:791)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:749) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:880) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:843) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:883) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:843) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:883) 
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:843) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:521) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:429) 
at com.abacus.newonlineordering.view.fragment.RoyaltyPointsFragment.onCreateView(RoyaltyPointsFragment.java:87) 
at android.app.Fragment.performCreateView(Fragment.java:2220) 
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973) 
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148) 
at android.app.BackStackRecord.run(BackStackRecord.java:793) 
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535) 
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:482) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5619) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:737) 
If the fragment has popup dialog, it will get the following error:
android.util.AndroidRuntimeException: requestFeature() must be called before adding content
at com.android.internal.policy.PhoneWindow.requestFeature(PhoneWindow.java:352)
at com.android.internal.app.AlertController.installContent(AlertController.java:264)
at android.app.AlertDialog.onCreate(AlertDialog.java:433)
at android.app.Dialog.dispatchOnCreate(Dialog.java:394)
at android.app.Dialog.show(Dialog.java:295)
at com.abacus.newonlineordering.tool.Utils.showAlertDialog(Utils.java:130)
at com.abacus.newonlineordering.view.fragment.SettingFragment.showConfirmMsg(SettingFragment.java:274)
at com.abacus.newonlineordering.view.fragment.SettingFragment.access$100(SettingFragment.java:53)
at com.abacus.newonlineordering.view.fragment.SettingFragment$2.onClick(SettingFragment.java:259)
at android.view.View.performClick(View.java:5212)
at android.view.View$PerformClick.run(View.java:21214)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5619)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:737)
The App works fine on other devices.
drawable/barcode (7f070061) is not a Drawable (color or path):
Removing such file which called barcode from drawables will help since it's not a drawable - color or path.
requestFeature() must be called before adding content at
Don't call setContentView() or onCreateView() before requestFeature()
Check this out: requestFeature() must be called before adding content

WebView crashed on Xiaomu Redmi Note 4

Working on an app with WebView:
in the layout file:
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
in the code:
mVideo = (WebView) findViewById(R.id.webview);
mVideo.loadUrl(mDeviceHost + ":8080/stream/webrtc");
But when I run on the device:
java.lang.RuntimeException: Unable to start activity ComponentInfo{tprlab.com.pitanq/com.tprlab.pitanq.DashboardActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class android.webkit.WebView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2785)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1532)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6342)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class android.webkit.WebView
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class android.webkit.WebView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:652)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:742)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:810)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:752)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:883)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:886)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
at android.view.LayoutInflater.inflate(LayoutInflater.java:522)
at android.view.LayoutInflater.inflate(LayoutInflater.java:430)
at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.tprlab.android.BaseActivity.onCreate(BaseActivity.java:55)
at com.tprlab.pitanq.DashboardActivity.onCreate(DashboardActivity.java:133)
at android.app.Activity.performCreate(Activity.java:6847)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2785)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1532)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6342)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
at android.app.ResourcesManager.appendLibAssetForMainAssetPath(ResourcesManager.java:889)
at android.webkit.WebViewDelegate.addWebViewAssetPath(WebViewDelegate.java:205)
at yH.a(PG:19)
at com.android.webview.chromium.WebViewChromium.<init>(PG:14)
at com.android.webview.chromium.WebViewChromiumFactoryProvider.createWebView(PG:158)
at android.webkit.WebView.ensureProviderCreated(WebView.java:2326)
at android.webkit.WebView.setOverScrollMode(WebView.java:2385)
07-11 12:38:13.983 24794-24794/tprlab.com.pitanq E/AndroidRuntime: at android.view.View.<init>(View.java:4007)
at android.view.View.<init>(View.java:4126)
at android.view.ViewGroup.<init>(ViewGroup.java:578)
at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:55)
at android.webkit.WebView.<init>(WebView.java:627)
at android.webkit.WebView.<init>(WebView.java:572)
at android.webkit.WebView.<init>(WebView.java:555)
at android.webkit.WebView.<init>(WebView.java:542)
Any ideas how to resolve that?
PS. Android version on the device: 7.0 NRD90M (sdk version 24)
Build options: min sdk version - 24
target - 26.
(is that key?)

Error inflating class B

I´ve a weird problem when building my signed App via AndroidStudio.
The app is generated successful, but when I want to start it on my smartphone I get the following error:
FATAL EXCEPTION: main
Process: my.package, PID: 21935
java.lang.RuntimeException: Unable to start activity ComponentInfo{my.package/gui.Main}: android.view.InflateException: Binary XML file line #58: Binary XML file line #58: Error inflating class Button
at android.app.ActivityThread.perfor
mLaunchActivity(ActivityThread.java:2984)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: android.view.InflateException: Binary XML file line #58: Binary XML file line #58: Error inflating class Button
Caused by: android.view.InflateException: Binary XML file line #58: Error inflating class Button
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.ae.a()' on a null object reference
at android.support.v7.widget.ag.setBackgroundDrawable(Unknown Source)
at android.view.View.setBackground(View.java:19498)
at android.view.View.<init>(View.java:4932)
at android.widget.TextView.<init>(TextView.java:1041)
at android.widget.Button.<init>(Button.java:113)
at android.widget.Button.<init>(Button.java:106)
at android.support.v7.widget.ag.<init>(Unknown Source)
at android.support.v7.widget.ag.<init>(Unknown Source)
at android.support.v7.a.au.a(Unknown Source)
at android.support.v7.a.af.a(Unknown Source)
at android.support.v4.g.ad.onCreateView(Unknown Source)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:865)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:873)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.inflate(LayoutInflater.java:525)
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
at android.preference.PreferenceFragment.onCreateView(PreferenceFragment.java:179)
at android.app.Fragment.performCreateView(Fragment.java:2352)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
at android.app.BackStackRecord.run(BackStackRecord.java:815)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1582)
at android.app.FragmentController.execPendingActions(FragmentController.java:372)
at android.app.Activity.performStart(Activity.java:6971)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2937)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
When I start the app via Debug mode or build a debug APK file, it starts normally.
I see that there is a problem with a button in one Binary XML file in line #58.
But in which file? In the Main class there is only a preference file without any button...
And why does it work in Debug mode?
Any idea?
Thanks!
When I disable proguard it works! :-)
But what is the problem with proguard?
Here is my Grandle file:
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
proguard.cfg:
-ignorewarnings

FirebaseUI InflateException, Error inflating class TextView

I'm trying to sign in with Firebase Auth. When I open the app, I recieve the following error:
03-09 16:25:02.532 20054-20054/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.udacity.gradle.builditbigger, PID: 20054
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.udacity.gradle.builditbigger/com.firebase.ui.auth.KickoffActivity}: android.view.InflateException: Binary XML file line #29: Binary XML file line #29: Error inflating class TextView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3003)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Caused by: android.view.InflateException: Binary XML file line #29: Binary XML file line #29: Error inflating class TextView
Caused by: android.view.InflateException: Binary XML file line #29: Error inflating class TextView
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x7f040077 a=4 r=0x7f06002c}
at android.content.res.TypedArray.getColorStateList(TypedArray.java:545)
at android.widget.TextView.<init>(TextView.java:1137)
at android.widget.TextView.<init>(TextView.java:1038)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:75)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:71)
at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1024)
at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1081)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:865)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.inflate(LayoutInflater.java:525)
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
at android.view.LayoutInflater.inflate(LayoutInflater.java:378)
at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:383)
at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323)
at android.support.v7.app.AppCompatDelegateImplV9.onPostCreate(AppCompatDelegateImplV9.java:170)
at android.support.v7.app.AppCompatActivity.onPostCreate(AppCompatActivity.java:97)
at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1207)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2975)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
I've looked through a number of S/O posts haven't seemed to find something that'll work. Is there an easy fix for this or should I just remove the FirebaseUI dependency and make my own login screen?

app stopped when a new theme is applied to the splash Screen

I've been trying to launch a new activity in my app and, although it does for a moment, inmediately after opening the new screen, the app stops.this things is done when i applied custom theme to splash screen layout.
com.androchunk.splash_screen E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.androchunk.splash_screen, PID: 3656
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androchunk.splash_screen/com.androchunk.splash_screen.Splash_Activity}: android.view.InflateException: Binary XML file line #0: Error inflating class ImageView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2455)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
at android.app.ActivityThread.access$800(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:189)
at android.app.ActivityThread.main(ActivityThread.java:5532)
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:950)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class ImageView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
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.androchunk.splash_screen.Splash_Activity.onCreate(Splash_Activity.java:13)
at android.app.Activity.performCreate(Activity.java:5966)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2408)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
at android.app.ActivityThread.access$800(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:189)
at android.app.ActivityThread.main(ActivityThread.java:5532)
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:950)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
Caused by: android.content.res.Resources$NotFoundException: Resource "com.androchunk.splash_screen:drawable/androchunk" (7f060054) is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f060054 a=-1 r=0x7f060054}
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2596)
at android.content.res.Resources.loadDrawable(Resources.java:2536)
at android.content.res.TypedArray.getDrawable(TypedArray.java:749)
at android.widget.ImageView.<init>(ImageView.java:146)
at android.widget.ImageView.<init>(ImageView.java:135)
at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:72)
at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:68)
at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106)
at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1024)
at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1081)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:725)
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.androchunk.splash_screen.Splash_Activity.onCreate(Splash_Activity.java:13)
at android.app.Activity.performCreate(Activity.java:5966)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2408)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
at android.app.ActivityThread.access$800(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:189)
at android.app.ActivityThread.main(ActivityThread.java:5532)
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:950)
at com.android.internal
In the 15 lines,it shows:
“Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class ImageView”
That means your ImageView has mistakes.
I think it may be caused by the construction method.To write the right custom Imageview,you must extend three construction method from the Imageview. If you miss one, that will result in mistakes.
In the line:
“Resource "com.androchunk.splash_screen:drawable/androchunk" (7f060054)”
It seems that your drawable resource file can‘t be found.
Check that your file is in the right path. Perhaps the file has been put in the wrong resolution like this:
res/drawable-xxx,res/drawable-xx

Categories

Resources