I'm developing Android app just for hobby, and I made an app, when I test on my phones works well, I tested on :
Alcatel idol OneTouch 2S ( 6050y )
Sony Xperia Tipo ( st21i )
Samsung Galaxy Ace
Asus Memo Pad HD7 (Tablet)
Works great, and no error at all...
but when I tested on Samsung Galaxy S4, and Samsung Galaxy S3..
no background music (on Galaxy S4 and no background pics are shown ), and what I click I see report error message so application crushes..
Error Log:
03-20 16:55:07.366: D/skia(29417): --- allocation failed for scaled bitmap
03-20 16:55:07.376: D/AndroidRuntime(29417): Shutting down VM
03-20 16:55:07.376: W/dalvikvm(29417): threadid=1: thread exiting with uncaught exception (group=0x4206c700)
03-20 16:55:07.391: E/AndroidRuntime(29417): FATAL EXCEPTION: main
03-20 16:55:07.391: E/AndroidRuntime(29417): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.**********a/com.***********a.Info}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.app.ActivityThread.access$700(ActivityThread.java:159)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.os.Handler.dispatchMessage(Handler.java:99)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.os.Looper.loop(Looper.java:176)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.app.ActivityThread.main(ActivityThread.java:5419)
03-20 16:55:07.391: E/AndroidRuntime(29417): at java.lang.reflect.Method.invokeNative(Native Method)
03-20 16:55:07.391: E/AndroidRuntime(29417): at java.lang.reflect.Method.invoke(Method.java:525)
03-20 16:55:07.391: E/AndroidRuntime(29417): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
03-20 16:55:07.391: E/AndroidRuntime(29417): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
03-20 16:55:07.391: E/AndroidRuntime(29417): at dalvik.system.NativeStart.main(Native Method)
03-20 16:55:07.391: E/AndroidRuntime(29417): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.view.LayoutInflater.createView(LayoutInflater.java:626)
03-20 16:55:07.391: E/AndroidRuntime(29417): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.view.LayoutInflater.inflate(LayoutInflater.java:470)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
03-20 16:55:07.391: E/AndroidRuntime(29417): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.app.Activity.setContentView(Activity.java:1956)
03-20 16:55:07.391: E/AndroidRuntime(29417): at *********.Info.onCreate(Info.java:16)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.app.Activity.performCreate(Activity.java:5372)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)
03-20 16:55:07.391: E/AndroidRuntime(29417): ... 11 more
03-20 16:55:07.391: E/AndroidRuntime(29417): Caused by: java.lang.reflect.InvocationTargetException
03-20 16:55:07.391: E/AndroidRuntime(29417): at java.lang.reflect.Constructor.constructNative(Native Method)
03-20 16:55:07.391: E/AndroidRuntime(29417): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.view.LayoutInflater.createView(LayoutInflater.java:600)
03-20 16:55:07.391: E/AndroidRuntime(29417): ... 23 more
03-20 16:55:07.391: E/AndroidRuntime(29417): Caused by: java.lang.OutOfMemoryError
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:832)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.content.res.Resources.loadDrawable(Resources.java:2988)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.view.View.<init>(View.java:3563)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.view.ViewGroup.<init>(ViewGroup.java:475)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.widget.LinearLayout.<init>(LinearLayout.java:176)
03-20 16:55:07.391: E/AndroidRuntime(29417): at android.widget.LinearLayout.<init>(LinearLayout.java:172)
03-20 16:55:07.391: E/AndroidRuntime(29417): ... 26 more
Please any help ?
Related
I have a simple Activity which shows an ImageView.
However, I sometimes receive bug report saying InflateException and OutOfMemoryError.
And those errors are pointing to the ImageView I have used.
I have made 4 different images for mdpi,hdpi,xhdpi,xxhdpi and used in ImageView.
File size of images: {6KB, 10KB, 14KB, 23KB}
Resolution of images: {192*192,288*288,384*384,576*576}
I believe the images is small enough that would not trigger OutOfMemoryError.
Does anyone know what is the problem?
xml file
<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=".SplashActivity">
<!--Below is #21-->
<ImageView
android:id="#+id/imageView"
android:layout_width="225dp"
android:layout_height="225dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="#drawable/splash" />
</RelativeLayout>
error trace
java.lang.RuntimeException: Unable to start activity ComponentInfo{SplashActivity}: android.view.InflateException: Binary XML file line #21: Error inflating class
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2328)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386)
at android.app.ActivityThread.access$900(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5476)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #21: Error inflating class
at android.view.LayoutInflater.createView(LayoutInflater.java:626)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:366)
at android.app.Activity.setContentView(Activity.java:2031)
at SplashActivity.onCreate(SplashActivity.java:60)
at android.app.Activity.performCreate(Activity.java:5451)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:600)
... 24 more
Caused by: java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:683)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:513)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:889)
at android.content.res.Resources.loadDrawable(Resources.java:3077)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.widget.ImageView.(ImageView.java:133)
at android.widget.ImageView.(ImageView.java:123)
... 27 more
android.view.InflateException: Binary XML file line #21: Error inflating class
at android.view.LayoutInflater.createView(LayoutInflater.java:626)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:366)
at android.app.Activity.setContentView(Activity.java:2031)
at SplashActivity.onCreate(SplashActivity.java:60)
at android.app.Activity.performCreate(Activity.java:5451)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386)
at android.app.ActivityThread.access$900(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5476)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:600)
... 24 more
Caused by: java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:683)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:513)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:889)
at android.content.res.Resources.loadDrawable(Resources.java:3077)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.widget.ImageView.(ImageView.java:133)
at android.widget.ImageView.(ImageView.java:123)
... 27 more
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:600)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:366)
at android.app.Activity.setContentView(Activity.java:2031)
at SplashActivity.onCreate(SplashActivity.java:60)
at android.app.Activity.performCreate(Activity.java:5451)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386)
at android.app.ActivityThread.access$900(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5476)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:683)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:513)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:889)
at android.content.res.Resources.loadDrawable(Resources.java:3077)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.widget.ImageView.(ImageView.java:133)
at android.widget.ImageView.(ImageView.java:123)
... 27 more
java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:683)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:513)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:889)
at android.content.res.Resources.loadDrawable(Resources.java:3077)
at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
at android.widget.ImageView.(ImageView.java:133)
at android.widget.ImageView.(ImageView.java:123)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:600)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:366)
at android.app.Activity.setContentView(Activity.java:2031)
at SplashActivity.onCreate(SplashActivity.java:60)
at android.app.Activity.performCreate(Activity.java:5451)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386)
at android.app.ActivityThread.access$900(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5476)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
I am new in phonegap and i am tring to login with facebook in phonegap using phonegap-facebook-plugin
i think there are some problem in my setup.
i have installed this plugin and add plugin in config.xml file.
<gap:plugin name="com.phonegap.plugins.facebookconnect">
<param name="APP_ID" value="1547160042188072" />
<param name="APP_NAME" value="XXXXXXXXXXX" />
</gap:plugin>
there is folder in plugin folder named as com.phonegap.plugins.facebookconnect. so i think plugin is add in project.
here is my html where i call the fb login fuinction
<img src="images/btnFB.png" class="socialimg">
my function is
function fbLogin(){
var fbLoginSuccess = function (userData) {
alert("UserInfo: " + JSON.stringify(userData));
}
facebookConnectPlugin.login(["public_profile"],
fbLoginSuccess,
function (error) { alert("" + error) }
);
}
when i call this function it gives error :
03-20 09:18:05.782: D/CordovaActivity(2607): Resuming the App
03-20 09:18:15.852: W/System.err(2607): java.lang.ClassNotFoundException: org.apache.cordova.facebook.ConnectPlugin
03-20 09:18:15.942: W/System.err(2607): at java.lang.Class.classForName(Native Method)
03-20 09:18:15.942: W/System.err(2607): at java.lang.Class.forName(Class.java:251)
03-20 09:18:15.962: W/System.err(2607): at java.lang.Class.forName(Class.java:216)
03-20 09:18:15.962: W/System.err(2607): at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:345)
03-20 09:18:15.962: W/System.err(2607): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:189)
03-20 09:18:15.982: W/System.err(2607): at org.apache.cordova.PluginManager.exec(PluginManager.java:137)
03-20 09:18:15.982: W/System.err(2607): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
03-20 09:18:15.992: W/System.err(2607): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:40)
03-20 09:18:15.992: W/System.err(2607): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
03-20 09:18:15.992: W/System.err(2607): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
03-20 09:18:15.992: W/System.err(2607): at android.os.Handler.dispatchMessage(Handler.java:102)
03-20 09:18:15.992: W/System.err(2607): at android.os.Looper.loop(Looper.java:136)
03-20 09:18:15.992: W/System.err(2607): at android.os.HandlerThread.run(HandlerThread.java:61)
03-20 09:18:15.992: W/System.err(2607): Caused by: java.lang.NoClassDefFoundError: org/apache/cordova/facebook/ConnectPlugin
03-20 09:18:15.992: W/System.err(2607): ... 13 more
03-20 09:18:16.022: W/System.err(2607): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.cordova.facebook.ConnectPlugin" on path: DexPathList[[zip file "/data/app/com.syonserver.couponspring-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.syonserver.couponspring-1, /system/lib]]
03-20 09:18:16.042: W/System.err(2607): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-20 09:18:16.042: W/System.err(2607): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
03-20 09:18:16.042: W/System.err(2607): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
03-20 09:18:16.042: W/System.err(2607): ... 13 more
03-20 09:18:16.052: I/System.out(2607): Error adding plugin org.apache.cordova.facebook.ConnectPlugin.
03-20 09:18:16.052: W/System.err(2607): java.lang.NullPointerException
03-20 09:18:16.052: W/System.err(2607): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:191)
03-20 09:18:16.052: W/System.err(2607): at org.apache.cordova.PluginManager.exec(PluginManager.java:137)
03-20 09:18:16.052: W/System.err(2607): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
03-20 09:18:16.052: W/System.err(2607): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:40)
03-20 09:18:16.052: W/System.err(2607): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
03-20 09:18:16.062: W/System.err(2607): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
03-20 09:18:16.062: W/System.err(2607): at android.os.Handler.dispatchMessage(Handler.java:102)
03-20 09:18:16.062: W/System.err(2607): at android.os.Looper.loop(Looper.java:136)
03-20 09:18:16.062: W/System.err(2607): at android.os.HandlerThread.run(HandlerThread.java:61)
please help.
It's looking for your ConnectPlugin class to be in the org.apache.cordova.facebook namespace. Check either what you have set for the package at the top of your ConnectPlugin.java file or under the org.apache.cordova.facebook namespace is there any file named ConnectPlugin.java.
The moto is that you have to kept a file under the org.apache.cordova.facebook namespace and name should be ConnectPlugin.java
I'm currently facing to a glitch from an Galaxy Tab 10.1 2 (GT-P5110) which give me that error, but just on that device. I tried on divers emulators (I use genymotion: Nexus 5-7-10, Galaxy S3-4-5, Galaxy Note 2-3) and devices (Galaxy S -2-3-4, Nexus 5-7).
But just on that Galaxy tab 2 10.1 (GT-P5110) I have this error.
I found this link, but this didn't really help me out to solve that problem.
07-01 11:06:58.832 14227-14227/com.********.********.com E/AndroidRuntime﹕ FATAL EXCEPTION: main
android.view.InflateException: Binary XML file line #36: Error inflating class com.package.fr.views.SofiaLiTextView
at android.view.LayoutInflater.createView(LayoutInflater.java:613)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at com.package.fr.fragments.TestFragment.onCreateView(TestFragment.java:82)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
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:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at com.package.fr.fragments.TestFragment.onCreateView(TestFragment.java:82)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
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:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NumberFormatException: Invalid int: "8.0dip"
at java.lang.Integer.invalidInt(Integer.java:138)
at java.lang.Integer.parse(Integer.java:375)
at java.lang.Integer.parseInt(Integer.java:366)
at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:123)
at android.content.res.TypedArray.getInt(TypedArray.java:254)
at android.widget.TextView.<init>(TextView.java:997)
at android.widget.TextView.<init>(TextView.java:562)
at com.package.fr.views.SofiaLiTextView.<init>(SofiaLiTextView.java:55)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at com.package.fr.fragments.TestFragment.onCreateView(TestFragment.java:82)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
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:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Apparently this would be a bug from the Samsung's Android like said here
Very frustrating >:)>:)
If you are using android:paddingstart attribute, make sure that your target api level is below 17, else try remove this attribute and run the app. It will work.
i do everything, research every but still not working. i read many page from here but not :(
I tried every solution.
Error logs:
03-20 14:46:49.627: I/Process(1895): Sending signal. PID: 1895 SIG: 9
03-20 14:46:59.608: E/Trace(1937): error opening trace file: No such file or directory (2)
03-20 14:46:59.608: W/Trace(1937): Unexpected value from nativeGetEnabledTags: 0
03-20 14:46:59.608: W/Trace(1937): Unexpected value from nativeGetEnabledTags: 0
03-20 14:46:59.608: W/Trace(1937): Unexpected value from nativeGetEnabledTags: 0
03-20 14:46:59.707: W/Trace(1937): Unexpected value from nativeGetEnabledTags: 0
03-20 14:46:59.707: W/Trace(1937): Unexpected value from nativeGetEnabledTags: 0
03-20 14:47:00.207: D/AndroidRuntime(1937): Shutting down VM
03-20 14:47:00.217: W/dalvikvm(1937): threadid=1: thread exiting with uncaught exception (group=0xb5dcc908)
03-20 14:47:00.327: E/AndroidRuntime(1937): FATAL EXCEPTION: main
03-20 14:47:00.327: E/AndroidRuntime(1937): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.panetest/com.example.panetest.PaneTest}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.ActivityThread.access$600(ActivityThread.java:141)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.os.Handler.dispatchMessage(Handler.java:99)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.os.Looper.loop(Looper.java:137)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.ActivityThread.main(ActivityThread.java:5039)
03-20 14:47:00.327: E/AndroidRuntime(1937): at java.lang.reflect.Method.invokeNative(Native Method)
03-20 14:47:00.327: E/AndroidRuntime(1937): at java.lang.reflect.Method.invoke(Method.java:511)
03-20 14:47:00.327: E/AndroidRuntime(1937): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-20 14:47:00.327: E/AndroidRuntime(1937): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-20 14:47:00.327: E/AndroidRuntime(1937): at dalvik.system.NativeStart.main(Native Method)
03-20 14:47:00.327: E/AndroidRuntime(1937): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-20 14:47:00.327: E/AndroidRuntime(1937): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.Activity.setContentView(Activity.java:1881)
03-20 14:47:00.327: E/AndroidRuntime(1937): at com.example.panetest.PaneTest.onCreate(PaneTest.java:16)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.Activity.performCreate(Activity.java:5104)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
03-20 14:47:00.327: E/AndroidRuntime(1937): ... 11 more
03-20 14:47:00.327: E/AndroidRuntime(1937): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.example.panetest.FirstPane: make sure class name exists, is public, and has an empty constructor that is public
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.Fragment.instantiate(Fragment.java:592)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.Fragment.instantiate(Fragment.java:560)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.Activity.onCreateView(Activity.java:4709)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
03-20 14:47:00.327: E/AndroidRuntime(1937): ... 21 more
03-20 14:47:00.327: E/AndroidRuntime(1937): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.panetest.FirstPane" on path: /data/app/com.example.panetest-1.apk
03-20 14:47:00.327: E/AndroidRuntime(1937): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
03-20 14:47:00.327: E/AndroidRuntime(1937): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
03-20 14:47:00.327: E/AndroidRuntime(1937): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
03-20 14:47:00.327: E/AndroidRuntime(1937): at android.app.Fragment.instantiate(Fragment.java:582)
03-20 14:47:00.327: E/AndroidRuntime(1937): ... 24 more
activity_pane_test.xml
<android.support.v4.widget.SlidingPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/slidingpanelayout">
<fragment android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.example.panetest.FirstPane"
android:id="#+id/fragment_firstpane"/>
<fragment android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.example.panetest.SecondPane"
android:id="#+id/fragment_secondpane"/>
PaneTest.java
package com.example.panetest;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.widget.SlidingPaneLayout;
import android.view.Menu;
public class PaneTest extends Activity {
SlidingPaneLayout pane; #Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pane_test);
pane = (SlidingPaneLayout) findViewById(R.id.slidingpanelayout);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.pane_test, menu);
return true;
}
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.panetest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.panetest.PaneTest"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Please anyone provide solution.
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.panetest.FirstPane" on path: /data/app/com.example.panetest-1.apk
Your project does not seem to have a class FirstPane in package com.example.panetest.
i'm noob at android and i face a strange exception when i try to settext or setcolor or anything that was working before
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
pageNoSeek = (SeekBar)findViewById(R.id.pageNoSeekBar);
pageNotv = (TextView)findViewById(R.id.pageNotv);
nextButton=(ImageButton)findViewById(R.id.leftButton);
backButton=(ImageButton)findViewById(R.id.rightButton);
mainText = (TextView)findViewById(R.id.mainText);
mainText.setTextColor(Color.RED);
}
as shown in code above there's nothing unusual .. acutally i've used this same code before at another machine .. it gives error at setTextColor or setTextSize if i added it..
> 03-20 07:55:17.552: E/AndroidRuntime(1718): FATAL EXCEPTION: main
03-20 07:55:17.552: E/AndroidRuntime(1718): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.thedarkdimension.keyboardShortcut/com.thedarkdimension.keyboardShortcut.StoryViewController}: java.lang.NullPointerException
03-20 07:55:17.552: E/AndroidRuntime(1718): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
03-20 07:55:17.552: E/AndroidRuntime(1718): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-20 07:55:17.552: E/AndroidRuntime(1718): at android.app.ActivityThread.access$600(ActivityThread.java:141)
03-20 07:55:17.552: E/AndroidRuntime(1718): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-20 07:55:17.552: E/AndroidRuntime(1718): at android.os.Handler.dispatchMessage(Handler.java:99)
03-20 07:55:17.552: E/AndroidRuntime(1718): at android.os.Looper.loop(Looper.java:137)
03-20 07:55:17.552: E/AndroidRuntime(1718): at android.app.ActivityThread.main(ActivityThread.java:5041)
03-20 07:55:17.552: E/AndroidRuntime(1718): at java.lang.reflect.Method.invokeNative(Native Method)
03-20 07:55:17.552: E/AndroidRuntime(1718): at java.lang.reflect.Method.invoke(Method.java:511)
03-20 07:55:17.552: E/AndroidRuntime(1718): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-20 07:55:17.552: E/AndroidRuntime(1718): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-20 07:55:17.552: E/AndroidRuntime(1718): at dalvik.system.NativeStart.main(Native Method)
03-20 07:55:17.552: E/AndroidRuntime(1718): Caused by: java.lang.NullPointerException
03-20 07:55:17.552: E/AndroidRuntime(1718): at com.thedarkdimension.keyboardShortcut.StoryViewController.getNextPage(StoryViewController.java:95)
03-20 07:55:17.552: E/AndroidRuntime(1718): at com.thedarkdimension.keyboardShortcut.StoryViewController.connectToDB(StoryViewController.java:84)
03-20 07:55:17.552: E/AndroidRuntime(1718): at com.thedarkdimension.keyboardShortcut.StoryViewController.onCreate(StoryViewController.java:47)
03-20 07:55:17.552: E/AndroidRuntime(1718): at android.app.Activity.performCreate(Activity.java:5104)
03-20 07:55:17.552: E/AndroidRuntime(1718): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
03-20 07:55:17.552: E/AndroidRuntime(1718): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
03-20 07:55:17.552: E/AndroidRuntime(1718): ... 11 more
and i can't get it .. can anyone help :)
From you code snippet for onCreate it seems that you have not called setContentView.
For this reason all calls for (X)findViewById(R.id.x); returns null and thus you are getting a Null Pointer Exception when you try to operate on the variables. [mainText is null since the view was not found].
Solution:
Call setContentView first and then initialize your variables and do the remaining stuff