I'm trying to show a MapView inside a Fragment and I get an error when I inflate it:
03-21 14:34:44.234 32691-32691/com.example.javiersanzrozalen.fatrunners E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.javiersanzrozalen.fatrunners, PID: 32691
android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class com.google.android.gms.maps.MapView
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class com.google.android.gms.maps.MapView
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:645) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) at android.view.LayoutInflater.inflate(LayoutInflater.java:495) at android.view.LayoutInflater.inflate(LayoutInflater.java:426) at com.example.javiersanzrozalen.fatrunners.Fragments.NuevaCarreraFragment.onCreateView(NuevaCarreraFragment.java:53) at android.support.v4.app.Fragment.performCreateView(Fragment.java:2192) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1299) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595) at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758) at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363 at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149) at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/safeparcel/AbstractSafeParcelable; at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source) at com.google.android.gms.maps.MapView.<init>(Unknown Source) at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:430) at android.view.LayoutInflater.createView(LayoutInflater.java:645) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) at android.view.LayoutInflater.inflate(LayoutInflater.java:495) at android.view.LayoutInflater.inflate(LayoutInflater.java:426) at com.example.javiersanzrozalen.fatrunners.Fragments.NuevaCarreraFragment.onCreateView(NuevaCarreraFragment.java:53) at android.support.v4.app.Fragment.performCreateView(Fragment.java:2192) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1299) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595) at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758) at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363 at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149) at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable" on path: DexPathList[[zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/base.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.javiersanzrozalen.fatrunners-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.javiersanzrozalen.fatrunners-2/lib/x86, /system/lib, /vendor/lib]]
03-21 14:34:44.234 32691-32691/com.example.javiersanzrozalen.fatrunners E/AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 27 more
Any idea ? This is the XML where I place my MapView:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Fragments.NuevaCarreraFragment">
<com.google.android.gms.maps.MapView
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
UPDATE
Finally solved it compiling the last version of Google Maps library recommended.
You are attempting to use the original version of Google Maps support for Android (com.google.android.maps). We refer to that now as Maps V1.
This will not work, as Maps V1 has been deprecated for over two years. You can no longer get API keys for it, so even if your code would be correct, it would not work. The crash is because the old MapView had to be used inside of a MapActivity, as the error indicates.
The current version of Google Maps support for Android — Maps V2 — has a very different API and does not involve classes in the com.google.android.maps package.
Related
When I debug my android app and I try to open my graph fragment, my app crashes. I put the "androidplot-core-1.5.7.aar" library in my "libs" project folder and implement it in my "build.gradle" dependencies.
I don't have this issue with the "androidplot-core-1.2.1.aar" library.
here is the graph fragment xml code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ap="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.androidplot.xy.XYPlot
android:id="#+id/imuPlot"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
style="#style/APDefacto.Light"/>
</LinearLayout>
Here is what it shows when I want to show a graph fragment and debug crashes :
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.poc2.irisa.plugandpos.poc2, PID: 5048
android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class com.androidplot.xy.XYPlot
Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.androidplot.xy.XYPlot
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:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at com.poc2.irisa.plugandpos.poc2.o.a(:52)
at android.support.v4.app.m.b(:2346)
at android.support.v4.app.z.a(:1428)
at android.support.v4.app.z.h(:1759)
at android.support.v4.app.z.a(:1827)
at android.support.v4.app.d.c(:797)
at android.support.v4.app.z.a(:2596)
at android.support.v4.app.z.b(:2383)
at android.support.v4.app.z.c(:2338)
at android.support.v4.app.z.p(:2245)
at android.support.v4.app.t.run(:703)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6120)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/halfhp/fig/Fig;
at com.androidplot.Plot.a(:561)
at com.androidplot.Plot.a(:403)
at com.androidplot.Plot.<init>(:324)
at com.androidplot.xy.XYPlot.<init>(:143)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at com.poc2.irisa.plugandpos.poc2.o.a(:52)
at android.support.v4.app.m.b(:2346)
at android.support.v4.app.z.a(:1428)
at android.support.v4.app.z.h(:1759)
at android.support.v4.app.z.a(:1827)
at android.support.v4.app.d.c(:797)
at android.support.v4.app.z.a(:2596)
at android.support.v4.app.z.b(:2383)
at android.support.v4.app.z.c(:2338)
at android.support.v4.app.z.p(:2245)
at android.support.v4.app.t.run(:703)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6120)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.halfhp.fig.Fig" on path: DexPathList[[zip file "/data/app/com.poc2.irisa.plugandpos.poc2-1/base.apk"],nativeLibraryDirectories=[/data/app/com.poc2.irisa.plugandpos.poc2-1/lib/arm, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.androidplot.Plot.a(:561)
at com.androidplot.Plot.a(:403)
at com.androidplot.Plot.<init>(:324)
at com.androidplot.xy.XYPlot.<init>(:143)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at com.poc2.irisa.plugandpos.poc2.o.a(:52)
at android.support.v4.app.m.b(:2346)
at android.support.v4.app.z.a(:1428)
at android.support.v4.app.z.h(:1759)
at android.support.v4.app.z.a(:1827)
at android.support.v4.app.d.c(:797)
at android.support.v4.app.z.a(:2596)
at android.support.v4.app.z.b(:2383)
at android.support.v4.app.z.c(:2338)
at android.support.v4.app.z.p(:2245)
at android.support.v4.app.t.run(:703)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6120)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'
Thanks in advance.
Best regards,
Malo
Just answering for myself after finding the question having had the same issue.
I had to add the following to my "build.gradle" dependencies.
implementation "com.halfhp.fig:figlib:1.0.7"
I know that this question is have asked many times and respective solution is on that portal, but none of them solve my problem.
I created an android project on android studio 3.0.1 and when I click on green symbol to run emulator, on AVD it shows me project has stopped--Open app again.
I saw the suggestion for this problem as Logcat and breakpoint and so on. But I don't know how actually use it.
I am new on android development so please help me how to use logcat or suggest me any other way to fix this problem my logcat is as follow:-
06-03 13:18:39.644 6812-6812/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.ram.projects6b, PID: 6812
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ram.projects6b/com.example.ram.projects6b.MainActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.v7.widget.Fab
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.v7.widget.Fab
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class android.support.v7.widget.Fab
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.Fab" on path: DexPathList[[zip file "/data/app/com.example.ram.projects6b-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.ram.projects6b-2/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.view.LayoutInflater.createView(LayoutInflater.java:609)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:286)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.ram.projects6b.MainActivity.onCreate(MainActivity.java:17)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
The problem describe with this error log:
android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class android.support.v7.widget.Fab
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class android.support.v7.widget.Fab
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.Fab" on path: DexPathList[[zip file
You're using incorrect View tag in your layout. You're using:
android.support.v7.widget.Fab
where there is no Fab View in Support library.
Probably what you wanted is FloatingActionButton:
android.support.design.widget.FloatingActionButton
I downloaded the tableview jar file library and copy to libs folder in my project and add it to gradle from File->Project Structure but there is problem when i add com.evrencoskun.tableview.TableView to xml and error :
Binary XML file line #11: Binary XML file line #11: Error inflating class com.evrencoskun.tableview.TableView
Caused by: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class com.evrencoskun.tableview.TableView
Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.evrencoskun.tableview.TableView
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:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
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.example.farzad.table.MainActivity.onCreate(MainActivity.java:13)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/evrencoskun/tableview/R$dimen;
at com.evrencoskun.tableview.TableView.initialDefaultValues(TableView.java:129)
at com.evrencoskun.tableview.TableView.<init>(TableView.java:116)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
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.example.farzad.table.MainActivity.onCreate(MainActivity.java:13)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.evrencoskun.tableview.R$dimen" on path: DexPathList[[zip file "/data/app/com.example.farzad.table-2/base.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.farzad.table-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.farzad.table-2/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.evrencoskun.tableview.TableView
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.evrencoskun.tableview.TableView>
</LinearLayout
package com.example.farzad.table;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
I don't want add this library by :
compile 'com.evrencoskun.library:tableview:0.8.8'
because i want to change it and add offline to my projects.
You got this issue, because your added jar did not compile. perhaps you are doing in wrong way.
Instead of telling way to add jar in android studio, i want tell you that if you want edit that library. You can clone it from library github page, and add that downloaded module to your app in Android Studio.
I am currently integrating Twilio Video with my AIR application. When I try Twilio VideoView in my activity layout, its giving error "Error inflating class com.twilio.video.VideoView"
Here is my layout
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:orientation="vertical"
tools:context="com.nethram.videoextn.views.MainActivity">
<Button
android:id="#+id/testBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="clickHandler"
android:text="#string/click" />
<com.twilio.video.VideoView
android:id="#+id/videoView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
I decompiled the jar file which is used to generate the ane extension file to check if Twilio video package is included or not. Twilio video packages are included in the jar file generated.
Here is the error I got
E/AndroidRuntime: FATAL EXCEPTION: main
Process: air.VideoApp, PID: 27627
java.lang.RuntimeException: Unable to start activity ComponentInfo{air.VideoApp/com.nethram.videoextn.views.MainActivity}: android.view.InflateException: Binary XML file line #16: Binary XML file line #16: Error inflating class com.twilio.video.VideoView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2456)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2539)
at android.app.ActivityThread.access$900(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1384)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5507)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #16: Binary XML file line #16: Error inflating class com.twilio.video.VideoView
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:401)
at android.app.Activity.setContentView(Activity.java:2196)
at com.nethram.videoextn.views.MainActivity.onCreate(MainActivity.java:26)
at android.app.Activity.performCreate(Activity.java:6304)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2539)
at android.app.ActivityThread.access$900(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1384)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5507)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class com.twilio.video.VideoView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:401)
at android.app.Activity.setContentView(Activity.java:2196)
at com.nethram.videoextn.views.MainActivity.onCreate(MainActivity.java:26)
at android.app.Activity.performCreate(Activity.java:6304)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2539)
at android.app.ActivityThread.access$900(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1384)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5507)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.twilio.video.VideoView" on path: DexPathList[[zip file "/data/app/air.VideoApp-1/base.apk"],nativeLibraryDirectories=[/data/app/air.VideoApp-1/lib/arm, /data/app/air.VideoApp-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.view.LayoutInflater.createView(LayoutInflater.java:583)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:401)
at android.app.Activity.setContentView(Activity.java:2196)
at com.nethram.videoextn.views.MainActivity.onCreate(MainActivity.java:26)
at android.app.Activity.performCreate(Activity.java:6304)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2539)
at android.app.ActivityThread.access$900(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1384)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5507)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Suppressed: java.lang.ClassNotFoundException: com.twilio.video.VideoView
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 24 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Any Idea how this can be solved. Found some answers on error type but non of these helped me out
Previously I was using AIR SDK version 16, old SDK versions doesn't have android v7 appcompat support while Twilio video SDK uses latest v7 support.
So after upgrading AIR SDK version to latest(currently v.29), I can integrate twilio VideoView in my layout.
I really don't know what's happening. On Android Studio every thing is working fine, but when I try to run the app on my phone it gives this error.
AndroidRuntime: FatalException:
Process: com.example.vb.textreader, PID: 29524
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.vb.textreader/com.example.vb.textreader.ocrcapture}: android.view.InflateException: Binary XML file line #10: Error inflating class com.example.vb.textreader.CameraSourcePreview
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394)
at android.app.ActivityThread.access$800(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5276)
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:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.example.vb.textreader.CameraSourcePreview
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:761)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:810)
at android.view.LayoutInflater.inflate(LayoutInflater.java:508)
at android.view.LayoutInflater.inflate(LayoutInflater.java:418)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.vb.textreader.ocrcapture.onCreate(ocrcapture.java:67)
at android.app.Activity.performCreate(Activity.java:6041)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2285)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394)
at android.app.ActivityThread.access$800(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5276)
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:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.vb.textreader.CameraSourcePreview" on path: DexPathList[[zip file "/data/app/com.example.vb.textreader-1/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.view.LayoutInflater.createView(LayoutInflater.java:575)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:747)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:810)
at android.view.LayoutInflater.inflate(LayoutInflater.java:508)
at android.view.LayoutInflater.inflate(LayoutInflater.java:418)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.vb.textreader.ocrcapture.onCreate(ocrcapture.java:67)
at android.app.Activity.performCreate(Activity.java:6041)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2285)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394)
at android.app.ActivityThread.access$800(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5276)
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:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
Suppressed: java.lang.ClassNotFoundException: Didn't find class "com.example.vb.textreader.CameraSourcePreview" on path: DexPathList[[dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-support-annotations-23.4.0_932ddf769cdf6f7ff910db3bda1b13074bfa8aca-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-internal_impl-23.4.0_ed28e3a48cbb17d2b91d4065fb1975ae0dafdc68-classes.dex", dex file "/data/data/com.example.vb.textreader/fil
I am trying to create an OCR app on android. There is no error in the code as viewed in Android Studio. Any help is greatly appreciated.
XML Code
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/topLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true">
<com.example.vb.textreader.proprietary.CameraSourcePreview
android:id="#+id/preview"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.example.vb.textreader.GraphicOverlay
android:id="#+id/graphicOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.example.vb.textreader.proprietary.CameraSourcePreview>
It seems that there is a custom view com.example.vb.textreader.CameraSourcePreview that's used in a XML layout file that's causing the problem.
Check it's attributes and implementation. if it depends on a library, check the dependencies in build.gradle.
It seems you are trying to use com.example.vb.textreader.CameraSourcePreview which must be a custom view you implemented. One thing that comes to my mind is to check to see if the custom view resides exactly at that location.
I'm not sure whether the provided solution is related to your issue but
try tocompile 'com.android.support:design:*****' instead of com.android.support:appcompat-v7:*****