Hi :) I have some problem including google maps in my android application. Ive been trying everything including extending MapActivity and adding this line to my project manifest <uses-library android:name="com.google.android.maps" /> . I still get the same errors.
Here is the logcat's output.
12-05 00:03:23.472: E/AndroidRuntime(24182): FATAL EXCEPTION: main
12-05 00:03:23.472: E/AndroidRuntime(24182): Process: com.example.package, PID: 24182
12-05 00:03:23.472: E/AndroidRuntime(24182): java.lang.RuntimeException: Unable to start activity ComponentInfo{...map.Map}: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.android.gms.maps.MapView
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread.access$800(ActivityThread.java:144)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.os.Handler.dispatchMessage(Handler.java:102)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.os.Looper.loop(Looper.java:135)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread.main(ActivityThread.java:5221)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.reflect.Method.invoke(Native Method)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.reflect.Method.invoke(Method.java:372)
12-05 00:03:23.472: E/AndroidRuntime(24182): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
12-05 00:03:23.472: E/AndroidRuntime(24182): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
12-05 00:03:23.472: E/AndroidRuntime(24182): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.android.gms.maps.MapView
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.createView(LayoutInflater.java:633)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
12-05 00:03:23.472: E/AndroidRuntime(24182): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.Activity.setContentView(Activity.java:2144)
12-05 00:03:23.472: E/AndroidRuntime(24182): at ...map.Map.onCreate(Map.java:28)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.Activity.performCreate(Activity.java:5933)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
12-05 00:03:23.472: E/AndroidRuntime(24182): ... 10 more
12-05 00:03:23.472: E/AndroidRuntime(24182): Caused by: java.lang.reflect.InvocationTargetException
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.reflect.Constructor.newInstance(Native Method)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
12-05 00:03:23.472: E/AndroidRuntime(24182): at android.view.LayoutInflater.createView(LayoutInflater.java:607)
12-05 00:03:23.472: E/AndroidRuntime(24182): ... 21 more
12-05 00:03:23.472: E/AndroidRuntime(24182): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/R$styleable;
12-05 00:03:23.472: E/AndroidRuntime(24182): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
12-05 00:03:23.472: E/AndroidRuntime(24182): at com.google.android.gms.maps.MapView.<init>(Unknown Source)
12-05 00:03:23.472: E/AndroidRuntime(24182): ... 24 more
12-05 00:03:23.472: E/AndroidRuntime(24182): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.R$styleable" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/.../base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
12-05 00:03:23.472: E/AndroidRuntime(24182): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
12-05 00:03:23.472: E/AndroidRuntime(24182): ... 26 more
12-05 00:03:23.472: E/AndroidRuntime(24182): Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.R$styleable
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.Class.classForName(Native Method)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
12-05 00:03:23.472: E/AndroidRuntime(24182): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
12-05 00:03:23.472: E/AndroidRuntime(24182): ... 27 more
12-05 00:03:23.472: E/AndroidRuntime(24182): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
12-05 00:03:25.050: I/Process(24182): Sending signal. PID: 24182 SIG: 9
Here's the only code I have so far
public class Map extends MapActivity {
MapView map_view;
GoogleMap map;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_map);
MapsInitializer.initialize(this);
map_view = (MapView) findViewById(R.id.map_view);
map_view.onCreate(savedInstanceState);
map = map_view.getMap();
map.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
The code seems to crash at this line : setContentView(R.layout.layout_map);
Thanks !
Related
I decided to create test example:
multidex true (1.0.1), rxjava 2.1.0, retrolambda 3.6.0
So I see bug on Android 4-6
Android 4
06-20 21:13:05.736 4123-4123/? E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: example.com.multidexandroid6rxjava.MainActivity$$Lambda$1
at example.com.multidexandroid6rxjava.MainActivity.onCreate(MainActivity.java:17)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Android 5.1.1
FATAL EXCEPTION: main
Process: example.com.multidexandroid6rxjava, PID: 3729
java.lang.NoClassDefFoundError: Failed resolution of: Lexample/com/multidexandroid6rxjava/MainActivity$$Lambda$1;
at example.com.multidexandroid6rxjava.MainActivity.onCreate(MainActivity.java:17)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "example.com.multidexandroid6rxjava.MainActivity$$Lambda$1" on path: DexPathList[[zip file "/data/app/example.com.multidexandroid6rxjava-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
Simple example
Please try the following code.
It worked on Android 6.
before
protected <T> void connectObservableField(#NonNull T observableField, #Nullable java.util.function.Consumer<? super T> consumer) {
after
protected <T> void connectObservableField(#NonNull T observableField, #Nullable io.reactivex.functions.Consumer<? super T> consumer) {
java.util.function.* seems not to work with retrolambda.
So you try to use io.reactivex.functions.Consumer instead.
See also https://github.com/orfjackal/retrolambda/issues/126#issuecomment-289307387
When I run the Xamarin Android Support v7 Cardview SAMPLE project, I get the following error: "Error inflating class android.support.v7.widget.CardView". How can I get this to work? Find below the stack trace.
Android.Views.InflateException: Binary XML file line #1: Error inflating class android.support.v7.widget.CardView ---> Java.Lang.Reflect.InvocationTargetException: ---> Java.Lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/cardview/R$styleable; ---> Java.Lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.supportv7cardview.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.supportv7cardview.sample-1/lib/arm, /vendor/lib, /system/lib]]
at --- End of managed exception stack trace ---
at java.lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.supportv7cardview.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.supportv7cardview.sample-1/lib/arm, /vendor/lib, /system/lib]]
at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at at android.support.v7.widget.CardView.initialize(CardView.java:203)
at at android.support.v7.widget.CardView.<init>(CardView.java:101)
at at java.lang.reflect.Constructor.newInstance(Native Method)
at at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
at at android.app.Activity.setContentView(Activity.java:2153)
at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.n_onCreate(Native Method)
at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.onCreate(MainActivity.java:28)
at at android.app.Activity.performCreate(Activity.java:5976)
at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at at android.app.ActivityThread.access$800(ActivityThread.java:144)
at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at at android.os.Handler.dispatchMessage(Handler.java:102)
at at android.os.Looper.loop(Looper.java:135)
at at android.app.ActivityThread.main(ActivityThread.java:5221)
at at java.lang.reflect.Method.invoke(Native Method)
at at java.lang.reflect.Method.invoke(Method.java:372)
at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
at Suppressed: java.lang.ClassNotFoundException: android.support.v7.cardview.R$styleable
at at java.lang.Class.classForName(Native Method)
at at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
at ... 28 more
at Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
--- End of inner exception stack trace ---
at --- End of managed exception stack trace ---
at java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/cardview/R$styleable;
at at android.support.v7.widget.CardView.initialize(CardView.java:203)
at at android.support.v7.widget.CardView.<init>(CardView.java:101)
at at java.lang.reflect.Constructor.newInstance(Native Method)
at at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
at at android.app.Activity.setContentView(Activity.java:2153)
at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.n_onCreate(Native Method)
at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.onCreate(MainActivity.java:28)
at at android.app.Activity.performCreate(Activity.java:5976)
at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at at android.app.ActivityThread.access$800(ActivityThread.java:144)
at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at at android.os.Handler.dispatchMessage(Handler.java:102)
at at android.os.Looper.loop(Looper.java:135)
at at android.app.ActivityThread.main(ActivityThread.java:5221)
at at java.lang.reflect.Method.invoke(Native Method)
at at java.lang.reflect.Method.invoke(Method.java:372)
at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
at Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.supportv7cardview.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.supportv7cardview.sample-1/lib/arm, /vendor/lib, /system/lib]]
at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at ... 27 more
at Suppressed: java.lang.ClassNotFoundException: android.support.v7.cardview.R$styleable
at at java.lang.Class.classForName(Native Method)
at at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
at ... 28 more
at Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
--- End of inner exception stack trace ---
at --- End of managed exception stack trace ---
at java.lang.reflect.InvocationTargetException
at at java.lang.reflect.Constructor.newInstance(Native Method)
at at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
at at android.app.Activity.setContentView(Activity.java:2153)
at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.n_onCreate(Native Method)
at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.onCreate(MainActivity.java:28)
at at android.app.Activity.performCreate(Activity.java:5976)
at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at at android.app.ActivityThread.access$800(ActivityThread.java:144)
at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at at android.os.Handler.dispatchMessage(Handler.java:102)
at at android.os.Looper.loop(Looper.java:135)
at at android.app.ActivityThread.main(ActivityThread.java:5221)
at at java.lang.reflect.Method.invoke(Native Method)
at at java.lang.reflect.Method.invoke(Method.java:372)
at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
at Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/cardview/R$styleable;
at at android.support.v7.widget.CardView.initialize(CardView.java:203)
at at android.support.v7.widget.CardView.<init>(CardView.java:101)
at ... 25 more
at Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.supportv7cardview.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.supportv7cardview.sample-1/lib/arm, /vendor/lib, /system/lib]]
at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at ... 27 more
at Suppressed: java.lang.ClassNotFoundException: android.support.v7.cardview.R$styleable
at at java.lang.Class.classForName(Native Method)
at at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
at ... 28 more
at Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3236/ee215fc9/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue* parms) [0x00084] in /Users/builder/data/lanes/3236/ee215fc9/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1029
at Android.App.Activity.SetContentView (Int32 layoutResID) [0x00070] in /Users/builder/data/lanes/3236/ee215fc9/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.App.Activity.cs:4403
at AndroidSupportSample.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x0000e] in /Users/Dennis/projects/cobalt-git/Rideshare-01/Components/xamandroidsupportv7cardview-23.1.1.1/samples/AndroidSupportSample/AndroidSupportSample/MainActivity.cs:27
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x00011] in /Users/builder/data/lanes/3236/ee215fc9/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.App.Activity.cs:2212
at at (wrapper dynamic-method) System.Object:855888e7-3749-47dd-bc4c-c0cf15ffd7a6 (intptr,intptr,intptr)
at --- End of managed exception stack trace ---
at android.view.InflateException: Binary XML file line #1: Error inflating class android.support.v7.widget.CardView
at at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
at at android.app.Activity.setContentView(Activity.java:2153)
at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.n_onCreate(Native Method)
at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.onCreate(MainActivity.java:28)
at at android.app.Activity.performCreate(Activity.java:5976)
at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at at android.app.ActivityThread.access$800(ActivityThread.java:144)
at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at at android.os.Handler.dispatchMessage(Handler.java:102)
at at android.os.Looper.loop(Looper.java:135)
at at android.app.ActivityThread.main(ActivityThread.java:5221)
at at java.lang.reflect.Method.invoke(Native Method)
at at java.lang.reflect.Method.invoke(Method.java:372)
at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
at Caused by: java.lang.reflect.InvocationTargetException
at at java.lang.reflect.Constructor.newInstance(Native Method)
at at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at ... 22 more
at Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/cardview/R$styleable;
at at android.support.v7.widget.CardView.initialize(CardView.java:203)
at at android.support.v7.widget.CardView.<init>(CardView.java:101)
at ... 25 more
at Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.supportv7cardview.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.supportv7cardview.sample-1/lib/arm, /vendor/lib, /system/lib]]
at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at ... 27 more
at Suppressed: java.lang.ClassNotFoundException: android.support.v7.cardview.R$styleable
at at java.lang.Class.classForName(Native Method)
at at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
at ... 28 more
at Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
If you find any issues in added library project fix those things
In eclipse do Project > Clean on the library project and the Android project will solve the problem
When I run the app the application crash.
I'm using the new android plugin 2.1.0
Failed to create directory /data/data/ric.es.pruebavideo/files/instant-run/dex
05-05
Couldn't create dex code folder
05-05 22:13:05.024 28257-28257/ric.es.pruebavideo D/AndroidRuntime: Shutting down VM
05-05 22:13:05.026 28257-28257/ric.es.pruebavideo E/AndroidRuntime: FATAL EXCEPTION: main
Process: ric.es.pruebavideo, PID: 28257
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ric.es.pruebavideo/ric.es.pruebavideo.VideoRActivity}: java.lang.ClassNotFoundException: Didn't find class "ric.es.pruebavideo.VideoRActivity" on path: DexPathList[[zip file "/data/app/ric.es.pruebavideo-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2236)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "ric.es.pruebavideo.VideoRActivity" on path: DexPathList[[zip file "/data/app/ric.es.pruebavideo-2/base.apk"],nativeLibraryDirectories=[/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.app.Instrumentation.newActivity(Instrumentation.java:1066)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2226)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Suppressed: java.lang.ClassNotFoundException: ric.es.pruebavideo.VideoRActivity
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)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
05-05 22:18:21.137 29791-29791/ric.es.pruebavideo D/Mobility: Selected camera resolution: 1280 x 720
05-05 22:18:21.210 29791-29791/ric.es.pruebavideo I/Choreographer: Skipped 30 frames! The application may be doing too much work on its main thread.
Downgrading grudle to 2.0.0 worked for me
I am trying to implement facebook login into my app seeingn this link
I am seeing lots of Rendering problems and some Exception in my xml file.
This is my xml
fragment_main.xml
<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:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:orientation="vertical"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin" tools:context=".MainActivityFragment">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="New Text"
android:id="#+id/textView"
android:layout_centerHorizontal="true"/>
<com.facebook.login.widget.LoginButton
android:id="#+id/login_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
The error is as below
Rendering Problems The following classes could not be found:
The following classes could not be instantiated :
- android.support.v7.internal.app.WindowDecorActionBar (Fix Build Path, Create Class)
Tip: Try to build the project. The following classes could not be instantiated:
The following classes could not be instantiated :
- com.facebook.login.widget.LoginButton (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE
Exception Details java.lang.NoClassDefFoundError: Could not initialize class com.facebook.login.widget.LoginButton at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70) at android.view.LayoutInflater.rInflate(LayoutInflater.java:811) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
What is this Rendering problem???
Whenever i start any project i'll end up with this Rendering Problem
In this app, when i run the project, app crashes with the follwoing log file
LOG FILE
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: Process: app.first.sinduja.fbfrnd, PID: 7027
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at android.os.AsyncTask$3.done(AsyncTask.java:309)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:242)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object reference
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:772)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:800)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at com.facebook.internal.Utility.queryAppSettings(Utility.java:802)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at com.facebook.login.widget.LoginButton$1.doInBackground(LoginButton.java:502)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at com.facebook.login.widget.LoginButton$1.doInBackground(LoginButton.java:499)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at android.os.AsyncTask$2.call(AsyncTask.java:295)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
Please help me with this project, thanks in advance.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am developing an app for all android devices. It is working good on all device and I tested it on Samsung Galaxy S1, Galaxy Nexus, Motorola Xoom, HTC One and also on Amazon Kindle Fire.
It runs perfectly on all devices but when i tried using it on Nexus 7, it crashes and in log it says Out of Memory Error. I tried using System.gc(); in Activity#onPause() method but in vain. There are alternative drawables and layouts exist in app.
Please help me to resolve this issue. This issue is only specific to Nexus 7.
Below is stacktrace:
12-05 16:42:45.625: E/AndroidRuntime(8759): FATAL EXCEPTION: main
12-05 16:42:45.625: E/AndroidRuntime(8759): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.app/com.android.app.activity.MyListActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.app.ActivityThread.access$600(ActivityThread.java:141)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.os.Handler.dispatchMessage(Handler.java:99)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.os.Looper.loop(Looper.java:137)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.app.ActivityThread.main(ActivityThread.java:5039)
12-05 16:42:45.625: E/AndroidRuntime(8759): at java.lang.reflect.Method.invokeNative(Native Method)
12-05 16:42:45.625: E/AndroidRuntime(8759): at java.lang.reflect.Method.invoke(Method.java:511)
12-05 16:42:45.625: E/AndroidRuntime(8759): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-05 16:42:45.625: E/AndroidRuntime(8759): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-05 16:42:45.625: E/AndroidRuntime(8759): at dalvik.system.NativeStart.main(Native Method)
12-05 16:42:45.625: E/AndroidRuntime(8759): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
12-05 16:42:45.625: E/AndroidRuntime(8759): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-05 16:42:45.625: E/AndroidRuntime(8759): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.app.Activity.setContentView(Activity.java:1881)
12-05 16:42:45.625: E/AndroidRuntime(8759): at com.android.app.activity.MyListActivity.onCreate(MyListActivity.java:39)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.app.Activity.performCreate(Activity.java:5104)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
12-05 16:42:45.625: E/AndroidRuntime(8759): ... 11 more
12-05 16:42:45.625: E/AndroidRuntime(8759): Caused by: java.lang.reflect.InvocationTargetException
12-05 16:42:45.625: E/AndroidRuntime(8759): at java.lang.reflect.Constructor.constructNative(Native Method)
12-05 16:42:45.625: E/AndroidRuntime(8759): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
12-05 16:42:45.625: E/AndroidRuntime(8759): ... 23 more
12-05 16:42:45.625: E/AndroidRuntime(8759): Caused by: java.lang.OutOfMemoryError
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.content.res.Resources.loadDrawable(Resources.java:1965)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.view.View.<init>(View.java:3328)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.view.ViewGroup.<init>(ViewGroup.java:431)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.widget.LinearLayout.<init>(LinearLayout.java:176)
12-05 16:42:45.625: E/AndroidRuntime(8759): at android.widget.LinearLayout.<init>(LinearLayout.java:172)
12-05 16:42:45.625: E/AndroidRuntime(8759): ... 26 more
Thanks in advance.
Ya i had faced this issue too but not found a valid solution but you can try using android:largeHeap="true" in manifest at application level