Sorry the application Sudoku has stopped unexpectly. Please try again - android

Help!
I’m having problems with my Sudoku application. I plugged in all the code to have my application remember the current position. Now when I run the application and I try to either start a new game or continue my Sudoku application says:
Sorry the application Sudoku (process org.example.sudoku) has stopped unexpectedly. Please try again.
It hasn’t done this in the past yet and I’m confused on where to go from here. I took a look at the logcat but I’m not sure what I should look for and how to fix it. Here is the logcat below
12-05 14:47:32.376: DEBUG/AndroidRuntime(289): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
12-05 14:47:32.376: DEBUG/AndroidRuntime(289): CheckJNI is ON
12-05 14:47:32.796: DEBUG/AndroidRuntime(289): —registering native functions --
12-05 14:47:34.306: DEBUG/AndroidRuntime(289): Shutting down VM
12-05 14:47:34.325: DEBUG/dalvikvm(289): Debugger has detached; object registry had 1 entries
12-05 14:47:34.345: INFO/AndroidRuntime(289): NOTE: attach of thread ‘Binder Thread #3’ failed
12-05 14:47:35.246: DEBUG/AndroidRuntime(297): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
12-05 14:47:35.246: DEBUG/AndroidRuntime(297): CheckJNI is ON
12-05 14:47:35.625: DEBUG/AndroidRuntime(297): —registering native functions --
12-05 14:47:36.985: INFO/ActivityManager(60): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0×10000000 cmp=org.example.sudoku/.Sudoku }
12-05 14:47:37.126: DEBUG/AndroidRuntime(297): Shutting down VM
12-05 14:47:37.146: DEBUG/dalvikvm(297): Debugger has detached; object registry had 1 entries
12-05 14:47:37.186: INFO/AndroidRuntime(297): NOTE: attach of thread ‘Binder Thread #3’ failed
12-05 14:47:37.359: INFO/ActivityManager(60): Start proc org.example.sudoku for activity org.example.sudoku/.Sudoku: pid=304 uid=10037 gids={}
12-05 14:47:39.327: INFO/ActivityManager(60): Displayed activity org.example.sudoku/.Sudoku: 2047 ms (total 333042 ms)
12-05 14:47:44.516: DEBUG/dalvikvm(128): GC_EXPLICIT freed 205 objects / 9864 bytes in 134ms
12-05 14:48:14.936: DEBUG/Sudoku(304): clicked on 0
12-05 14:48:14.957: INFO/ActivityManager(60): Starting activity: Intent { cmp=org.example.sudoku/.Game (has extras) }
12-05 14:48:15.146: DEBUG/AndroidRuntime(304): Shutting down VM
12-05 14:48:15.146: WARN/dalvikvm(304): threadid=1: thread exiting with uncaught exception (group=0×4001d800)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): FATAL EXCEPTION: main
12-05 14:48:15.295: ERROR/AndroidRuntime(304): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.example.sudoku/org.example.sudoku.Game}: java.lang.NullPointerException
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.os.Handler.dispatchMessage(Handler.java:99)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.os.Looper.loop(Looper.java:123)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at java.lang.reflect.Method.invokeNative(Native Method)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at java.lang.reflect.Method.invoke(Method.java:521)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at dalvik.system.NativeStart.main(Native Method)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): Caused by: java.lang.NullPointerException
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.content.ContextWrapper.getPackageName(ContextWrapper.java:120)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.Activity.getLocalClassName(Activity.java:3478)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.Activity.getPreferences(Activity.java:3512)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at org.example.sudoku.Game.<init>(Game.java:104)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at java.lang.Class.newInstanceImpl(Native Method)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at java.lang.Class.newInstance(Class.java:1429)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
12-05 14:48:15.295: ERROR/AndroidRuntime(304): ... 11 more
12-05 14:48:15.376: WARN/ActivityManager(60): Force finishing activity org.example.sudoku/.Game
12-05 14:48:15.455: WARN/ActivityManager(60): Force finishing activity org.example.sudoku/.Sudoku
12-05 14:48:15.927: WARN/ActivityManager(60): Activity pause timeout for HistoryRecord{44049308 org.example.sudoku/.Game}
12-05 14:48:27.095: WARN/ActivityManager(60): Activity destroy timeout for HistoryRecord{43f562c0 org.example.sudoku/.Sudoku}
12-05 14:48:27.202: WARN/ActivityManager(60): Activity destroy timeout for HistoryRecord{44049308 org.example.sudoku/.Game}
12-05 14:49:20.407: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
Any help would be greatly appreciated. Thank you
-James

You need to look at line 104 of Game.java as it seems it may be the cause of a NullPointerException

Your error of interest is:
12-05 14:48:15.295: ERROR/AndroidRuntime(304): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.example.sudoku/org.example.sudoku.Game}: java.lang.NullPointerException
Usual error - your intent is not in the Manifest.xml

Related

Android emulator crash

Hey everyone I'm new to android programming so this should be pretty basic.
No matter what I do the android emulator crashes. To show how little it takes for this to happen, I've opened a new project called MyApplication, added a button to my xml file, and ran the button. After I run this button I get "Unfortunately MyApplication has stopped" When it should just allow me to click constantly. Ive already tried changing the ram, making sure the emulator is on host GPU, and making sure i opened a brand new application while changing no defaults and adding nothing but a simple button. Why is this happening?
Button code:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Here"
android:onClick="onClick"
android:id="#+id/button"
/>
Logcat:
12-05 13:06:35.459 1974-1974/com.example.owner.myapplication I/art: Not late-enabling -Xcheck:jni (already on)
12-05 13:06:35.459 1974-1974/com.example.owner.myapplication I/art: Late-enabling JIT
12-05 13:06:35.461 1974-1974/com.example.owner.myapplication I/art: JIT created with code_cache_capacity=2MB compile_threshold=1000
12-05 13:06:35.488 1974-1974/com.example.owner.myapplication W/System: ClassLoader referenced unknown path: /data/app/com.example.owner.myapplication-1/lib/x86
12-05 13:06:35.567 1974-1989/com.example.owner.myapplication D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
12-05 13:06:35.568 1974-1974/com.example.owner.myapplication D/: HostConnection::get() New Host Connection established 0xab795310, tid 1974
12-05 13:06:35.607 1974-1989/com.example.owner.myapplication I/OpenGLRenderer: Initialized EGL, version 1.4
12-05 13:06:35.641 1974-1989/com.example.owner.myapplication W/EGL_emulation: eglSurfaceAttrib not implemented
12-05 13:06:35.641 1974-1989/com.example.owner.myapplication W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xabf217e0, error=EGL_SUCCESS
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication D/AndroidRuntime: Shutting down VM
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: Process: com.example.owner.myapplication, PID: 1974
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: java.lang.IllegalStateException: Could not find method onClick(View) in a parent or ancestor Context for android:onClick attribute defined on view class android.support.v7.widget.AppCompatButton with id 'button'
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at android.support.v7.internal.app.AppCompatViewInflater$DeclaredOnClickListener.resolveMethod(AppCompatViewInflater.java:310)
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at android.support.v7.internal.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:269)
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at android.view.View.performClick(View.java:5198)
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at android.view.View$PerformClick.run(View.java:21147)
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
12-05 13:06:36.999 1974-1974/com.example.owner.myapplication E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
12-05 13:06:38.800 1974-1974/? I/Process: Sending signal. PID: 1974 SIG: 9
Just make sure your activity has the following method:
public void onClick (View view) {
// your logic
}
Try to write somw logic inside the Onclick function
Unless you write a code in the onclick function the emulator will show you an error
As you have not defined what needs to be done Onclicking the button
Try writing a code of toast or new Intent in the onclick so that something actually happens and the OS knows what shall be done after clicking the button

ParseLoginSampleBasic giving exception when I push the Log In button on the first screen (Android)

I just started developing with parse. I downloaded the android ParseLoginUI and the sample apps. Two things I had done to be able to start the app: for ParseLoginUI add a reference to the FacebookSDK and copy the "bolts-android-1.1.2.jar" file from the FacebookSDK libs folder to the ParseLoginUI lib folder.
The ParseLoginSampleBasic runs, the first screen comes up, but when I click on the Log in button , this exception comes up:
12-05 12:02:31.151: E/dalvikvm(24615): Could not find class 'com.parse.ui.ParseLoginActivity', referenced from method com.parse.ui.ParseLoginBuilder.build
12-05 12:02:32.606: E/AndroidRuntime(24615): FATAL EXCEPTION: main
12-05 12:02:32.606: E/AndroidRuntime(24615): Process: com.parse.loginsample.basic, PID: 24615
12-05 12:02:32.606: E/AndroidRuntime(24615): java.lang.NoClassDefFoundError: com.parse.ui.ParseLoginActivity
12-05 12:02:32.606: E/AndroidRuntime(24615): at com.parse.ui.ParseLoginBuilder.build(ParseLoginBuilder.java:309)
12-05 12:02:32.606: E/AndroidRuntime(24615): at com.parse.loginsample.basic.SampleProfileActivity$1.onClick(SampleProfileActivity.java:71)
12-05 12:02:32.606: E/AndroidRuntime(24615): at android.view.View.performClick(View.java:4456)
12-05 12:02:32.606: E/AndroidRuntime(24615): at android.view.View$PerformClick.run(View.java:18482)
12-05 12:02:32.606: E/AndroidRuntime(24615): at android.os.Handler.handleCallback(Handler.java:733)
12-05 12:02:32.606: E/AndroidRuntime(24615): at android.os.Handler.dispatchMessage(Handler.java:95)
12-05 12:02:32.606: E/AndroidRuntime(24615): at android.os.Looper.loop(Looper.java:136)
12-05 12:02:32.606: E/AndroidRuntime(24615): at android.app.ActivityThread.main(ActivityThread.java:5097)
12-05 12:02:32.606: E/AndroidRuntime(24615): at java.lang.reflect.Method.invokeNative(Native Method)
12-05 12:02:32.606: E/AndroidRuntime(24615): at java.lang.reflect.Method.invoke(Method.java:515)
12-05 12:02:32.606: E/AndroidRuntime(24615): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
12-05 12:02:32.606: E/AndroidRuntime(24615): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
12-05 12:02:32.606: E/AndroidRuntime(24615): at dalvik.system.NativeStart.main(Native Method)

null pointer on calling ContentResolver.setSyncAutomatically android

I want to sync my local app database with my remote server database using android sync adapter. I followed all steps mentioned in developer website and I double checked every thing. but I get null pointer when lines below executed in my MainActivity oncreate:
mAccount = CreateSyncAccount(this);
ContentResolver.setSyncAutomatically(mAccount, AUTHORITY, true);
here is my stacktrace:
12-05 15:05:40.099: E/AndroidRuntime(13641): FATAL EXCEPTION: main
12-05 15:05:40.099: E/AndroidRuntime(13641): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mobinMahsaz.dortan/com.mobinMahsaz.dortan.MainActivity2}: java.lang.NullPointerException
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.os.Handler.dispatchMessage(Handler.java:99)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.os.Looper.loop(Looper.java:130)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.app.ActivityThread.main(ActivityThread.java:3687)
12-05 15:05:40.099: E/AndroidRuntime(13641): at java.lang.reflect.Method.invokeNative(Native Method)
12-05 15:05:40.099: E/AndroidRuntime(13641): at java.lang.reflect.Method.invoke(Method.java:507)
12-05 15:05:40.099: E/AndroidRuntime(13641): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
12-05 15:05:40.099: E/AndroidRuntime(13641): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
12-05 15:05:40.099: E/AndroidRuntime(13641): at dalvik.system.NativeStart.main(Native Method)
12-05 15:05:40.099: E/AndroidRuntime(13641): Caused by: java.lang.NullPointerException
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.os.Parcel.readException(Parcel.java:1328)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.os.Parcel.readException(Parcel.java:1276)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.content.IContentService$Stub$Proxy.setSyncAutomatically(IContentService.java:568)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.content.ContentResolver.setSyncAutomatically(ContentResolver.java:1047)
12-05 15:05:40.099: E/AndroidRuntime(13641): at com.mobinMahsaz.dortan.MainActivity2.onCreate(MainActivity2.java:283)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-05 15:05:40.099: E/AndroidRuntime(13641): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
12-05 15:05:40.099: E/AndroidRuntime(13641): ... 11 more
I can't find any documentation that states what is the reason of this exception.
EDIT:
After reading ContentResolver documentation I find out null pointer cause by getcontentService().
It could be different for you, but for me this was caused because I had a null mAccount object. I had incorrectly assumed that if AccountManager.addAccountExplicitly returned false then there had been a fatal error, so was returning a null Account from my CreateSyncAccount function in that situation.

Out of Memory Error Nexus 7 android 4.2.1 [closed]

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

Android app crashes as i try to use kSoap2

Hi im new to Android development.. Sorry.
My Android App crashes as i am trying to use kSoap2 to connect the app to a web service:
My Error log is as follows:
2-05 12:48:05.100: E/dalvikvm(749): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method com.example.mytestws.MainActivity.onCreate
12-05 12:48:05.100: W/dalvikvm(749): VFY: unable to resolve new-instance 548 (Lorg/ksoap2/serialization/SoapObject;) in Lcom/example/mytestws/MainActivity;
12-05 12:48:05.100: D/dalvikvm(749): VFY: replacing opcode 0x22 at 0x0012
12-05 12:48:05.100: D/dalvikvm(749): VFY: dead code 0x0014-0057 in Lcom/example/mytestws/MainActivity;.onCreate (Landroid/os/Bundle;)V
12-05 12:48:05.250: D/AndroidRuntime(749): Shutting down VM
12-05 12:48:05.250: W/dalvikvm(749): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
12-05 12:48:05.261: E/AndroidRuntime(749): FATAL EXCEPTION: main
12-05 12:48:05.261: E/AndroidRuntime(749): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
12-05 12:48:05.261: E/AndroidRuntime(749): at com.example.mytestws.MainActivity.onCreate(MainActivity.java:29)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.os.Handler.dispatchMessage(Handler.java:99)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.os.Looper.loop(Looper.java:123)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-05 12:48:05.261: E/AndroidRuntime(749): at java.lang.reflect.Method.invokeNative(Native Method)
12-05 12:48:05.261: E/AndroidRuntime(749): at java.lang.reflect.Method.invoke(Method.java:521)
12-05 12:48:05.261: E/AndroidRuntime(749): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-05 12:48:05.261: E/AndroidRuntime(749): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-05 12:48:05.261: E/AndroidRuntime(749): at dalvik.system.NativeStart.main(Native Method)
You have to add ksoap2 library to your classpath as an external library and also copy the .jar into libs folder of the project.

Categories

Resources