When I am launching my application, I am getting the error:
04-29 10:20:15.655: E/AndroidRuntime(24548): android.view.InflateException: Binary XML file line #2: Error inflating class com.mobeta.android.dslv.DragSortListView
Here is my XML file:
<?xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dslv="http://schemas.android.com/apk/res-auto"
android:id="#android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="7dp"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:layout_margin="0dp"
android:dividerHeight="5dp"
dslv:drag_enabled="true"
dslv:collapsed_height="2dp"
dslv:drag_scroll_start="0.33"
dslv:max_drag_scroll_speed="0.5"
dslv:float_alpha="0.6"
dslv:slide_shuffle_speed="0.3"
dslv:track_drag_sort="false"
dslv:use_default_controller="true"
dslv:sort_enabled="false"
dslv:remove_enabled="true"
dslv:remove_mode="flingRemove"
android:background="#E5E5E5" />
Does anyone know whats causing the issue? When I attempt to specify the full url "http://schemas.android.com/apk/res/com.mobeta.android.demodslv", the project does not compile.
change xmlns:dslv="http://schemas.android.com/apk/res-auto"
to below line
xmlns:dslv="http://schemas.android.com/apk/lib/com.mobeta.android.dslv"
Related
I am trying to figure this issue but I don't understand why my Vector/png drawable is missing when I put them all in respective directory/folder.
Here is the below logs.
Fatal Exception: android.view.InflateException: Binary XML file line #42 in com.ex.abc:layout/my_layout: Binary XML file line #42 in com.ex.abc:layout/my_layout: Error inflating class <unknown>
Caused by android.content.res.Resources$NotFoundException: Resource ID #0x7f0800aa
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:295)
at android.content.res.Resources.getValue(Resources.java:1516)
at androidx.appcompat.widget.ResourceManagerInternal.c(ResourceManagerInternal.java:19)
at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:235)
at androidx.appcompat.widget.ResourceManagerInternal.getDrawable(ResourceManagerInternal.java:2)
at androidx.appcompat.content.res.AppCompatResources.getDrawable(AppCompatResources.java:4)
at com.google.android.material.resources.MaterialResources.getDrawable(MaterialResources.java:13)
at com.google.android.material.button.MaterialButton.<init>(MaterialButton.java:87)
at java.lang.reflect.Constructor.newInstance0(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:873)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1061)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1016)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1178)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1139)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1181)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1139)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1181)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1139)
at android.view.LayoutInflater.inflate(LayoutInflater.java:696)
at android.view.LayoutInflater.inflate(LayoutInflater.java:548)
at com.ex.abc.databinding.MyLayoutBinding.a(MyLayoutBinding.java:4)
at com.ex.abc.fragments.BSDialog.Q(BSDialog.java:6)
at androidx.fragment.app.Fragment.b0(Fragment.java:20)
at androidx.fragment.app.DialogFragment.performCreateView(DialogFragment.java)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:223)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:154)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1069)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:91)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:74)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:3)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:257)
at android.app.ActivityThread.main(ActivityThread.java:8218)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
Here is my layout file snippet code and at line 49 its drawable
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/messageBehaviorView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp"
app:behavior_hideable="true"
app:behavior_peekHeight="0dp">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:orientation="horizontal">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="10dp"
android:background="#afafaf">
<Spinner
android:id="#+id/spColorStyle"
style="#style/spinner"
android:contentDescription="#string/style" />
</FrameLayout>
<com.google.android.material.button.MaterialButton
android:id="#+id/btnAngle"
style="#style/ButtonStyle.Circle.Small"
android:layout_marginStart="0dp"
android:layout_marginEnd="10dp"
android:contentDescription="#string/rotate"
app:icon="#drawable/ic_arrow_angle" />
</LinearLayout>
</HorizontalScrollView>
My Vector code
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF">
<path
android:fillColor="#android:color/white"
android:pathData="M12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8s8,3.59 8,8S16.41,20 12,20M12,22c5.52,0 10,-4.48 10,-10c0,-5.52 -4.48,-10 -10,-10C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22L12,22zM11,12l0,4h2l0,-4h3l-4,-4l-4,4H11z"/>
</vector>
I don't understand some android devices not able to use this resource and cause issue. My crashlytics error log for last 30 days.
In my Android app, I customize a Notification view that shows some buttons in XML file as below. It worked for most of devices, but showing this error on Huawei Nova i7:
Couldn't inflate contentViewsandroid.view.InflateException: Binary XML file line #13 in my_app_package:layout/notification_idle: Binary XML file line #13 in my_app_package:layout/notification_idle: Error inflating class huawei.android.widget.ImageView
android.app.ActivityThread$H.handleMessage
I wonder why it is huawei.android.widget.ImageView in the error message. It should be: android.widget.ImageView as my understanding.
If you have an answer, that would be appreciated.
Here is my XML file for the notification view
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:paddingStart="#dimen/gap_small"
android:paddingEnd="0dp"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<ImageView
android:id="#+id/logoView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#null"
android:src="#drawable/ic_notification_logo"/>`
Hi to all i'm trying to add the facebook login avaible in the facebook sdk (i'm using the 4.16.0 ver) but i got this error
android.view.InflateException: Binary XML file line #0: Binary XML
file line #0: Error inflating class
com.facebook.login.widget.LoginButton
Caused by: android.view.InflateException: Binary XML file line #0:
Error inflating class com.facebook.login.widget.LoginButton
i'm already read here but it did not work for me i post here my build.gradle file
Thank's to all!
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/layoutLogin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/cardview_light_background"
android:orientation="vertical">
<ImageView
android:id="#+id/imageView4"
android:layout_width="match_parent"
android:layout_height="456dp"
android:contentDescription="imm"
android:src="#drawable/lloyd_thumbs" />
<Space
android:layout_width="match_parent"
android:layout_height="25dp" />
<Button
android:id="#+id/log_or_reg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/cardview_shadow_end_color"
android:text="Loggati e/o Registrati" />
<com.facebook.login.widget.LoginButton
android:id="#+id/login_button"
android:layout_width="344dp"
android:layout_height="54dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="30dp"
android:layout_marginTop="30dp" />
</LinearLayout>
edit: the problem is only when I try to inflate the activity, if I use intent I don't have any problem
This is probably because you haven't initialised the Facebook SDK.
Initiate that in the application class as below.
public class AppController extends Application {
#Override
public void onCreate() {
super.onCreate();
FacebookSdk.sdkInitialize(this);
}
}
If you have the same problem, try this.
in your buil.gradle file add this
compile 'com.android.support:multidex:1.0.0'
and add in default config this
default config{
//other stuff
multiDexEnabled true
//other stuff
}
and in yuor application add this MultiDex.install(this);
Thank's myself for answer!
I've been trying to get this widget working in my Android project: https://code.google.com/p/android-coverflow/source/browse/
It's called Coverflow, and it kind of replaces the old Gallery widget. Implementing it seemed pretty straightforward until I got the error:
08-16 17:33:08.289: E/AndroidRuntime(15031): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class pl.polidea.coverflow.CoverFlow
This is the XML file the error is referring to:
<pl.polidea.coverflow.CoverFlow class="pl.polidea.coverflow.CoverFlow"
android:id="#+id/coverflow"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip" >
</pl.polidea.coverflow.CoverFlow>
This question has been asked before on StackOverflow but the answer given here: Android coverflow : Error inflating class pl.polidea.coverflow.CoverFlow didn't work for me.
You should Use by this way:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<view class="pl.polidea.coverflow.CoverFlow" xmlns:coverflow="http://schemas.android.com/apk/res/pl.polidea.coverflow"
coverflow:imageWidth="100dip" coverflow:imageHeight="150dip" android:id="#+id/coverflow" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_marginTop="5dip">
</view>
<pl.polidea.coverflow.CoverFlow xmlns:coverflow="http://schemas.android.com/apk/res/pl.polidea.coverflow"
coverflow:imageWidth="100dip" coverflow:imageHeight="150dip" coverflow:withReflection="true"
coverflow:imageReflectionRatio="0.2" coverflow:reflectionGap="2dip" android:id="#+id/coverflowReflect"
android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" />
<TextView android:text="STATUS" android:layout_width="fill_parent" android:layout_height="wrap_content"
android:padding="5dip" android:id="#+id/statusText"></TextView>
</LinearLayout>
Make sure that "pl.polidea.coverflow.CoverFlow" is your class file(package+java class)...
Else replace "pl.polidea.coverflow.CoverFlow" in your xml with your actual class file having coverflow!!
I've just updated my android with sdk-r17 and eclipse with ADT-17. Now all my applications that use admob caused force close after building and running it either on real device or emulator (It worked well before updating)
Here is my xml layout:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.ads.AdView
android:id="#+id/admob"
android:layout_alignParentBottom="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="xxxxxx"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"/>
<ListView
android:id="#+id/lv_agent"
android:layout_above="#id/admob"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#00000000"
android:focusable="true"
android:layoutAnimation="#anim/l_slide_right"
android:listSelector="#drawable/bg_list_selector"
android:divider="#3f3f3f"
The logcat error message is:
AndroidRuntime(29533): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{net.londatiga.xxx/net.londatiga.xxx.xxx}: android.view.InflateException: Binary XML file line #19: Error inflating class com.google.ads.AdView
Any solutions?
This issue is a dependency jars in Android projects. The solution seems to see http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17