I have an activty with a button i would like to start a FragmentActivity using this button.
but my problem is my Activity is unknown. I checked My AndroidManifest all my Activities are declared . you find below the Log. In this class I am using an external lib.
08-02 10:51:49.574: E/dalvikvm(12660): Could not find class 'edu.dartmouth.cs.actiontabs.ViewPagerActivity', referenced from method edu.dartmouth.cs.actiontabs.TestActivity$1.onClick
08-02 10:51:49.714: E/SpannableStringBuilder(12660): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
08-02 10:51:52.035: E/AndroidRuntime(12660): FATAL EXCEPTION: main
08-02 10:51:52.035: E/AndroidRuntime(12660): java.lang.NoClassDefFoundError: edu.dartmouth.cs.actiontabs.ViewPagerActivity
08-02 10:51:52.035: E/AndroidRuntime(12660): at edu.dartmouth.cs.actiontabs.TestActivity$1.onClick(TestActivity.java:28)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.view.View.performClick(View.java:4222)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.view.View$PerformClick.run(View.java:17337)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.os.Handler.handleCallback(Handler.java:615)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.os.Handler.dispatchMessage(Handler.java:92)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.os.Looper.loop(Looper.java:137)
08-02 10:51:52.035: E/AndroidRuntime(12660): at android.app.ActivityThread.main(ActivityThread.java:4895)
08-02 10:51:52.035: E/AndroidRuntime(12660): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 10:51:52.035: E/AndroidRuntime(12660): at java.lang.reflect.Method.invoke(Method.java:511)
08-02 10:51:52.035: E/AndroidRuntime(12660): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
08-02 10:51:52.035: E/AndroidRuntime(12660): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
08-02 10:51:52.035: E/AndroidRuntime(12660): at dalvik.system.NativeStart.main(Native Method)
the declaration of my Activity in the manifest file:
<activity android:name="edu.dartmouth.cs.actiontabs.ViewPagerActivity" >
</activity>
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
08-02 20:48:36.703: D/EditText(3575): nouy
08-02 20:48:36.793: I/Choreographer(3575): Skipped 68 frames! The application may be doing too much work on its main thread.
08-02 20:48:37.143: D/dalvikvm(3575): GC_CONCURRENT freed 1331K, 34% free 2956K/4428K, paused 4ms+59ms, total 137ms
08-02 20:48:37.353: D/AndroidRuntime(3575): Shutting down VM
08-02 20:48:37.394: W/dalvikvm(3575): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
08-02 20:48:37.443: E/AndroidRuntime(3575): FATAL EXCEPTION: main
08-02 20:48:37.443: E/AndroidRuntime(3575): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.note/com.example.note.NoteEdit}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.app.ActivityThread.access$600(ActivityThread.java:141)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.os.Looper.loop(Looper.java:137)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.app.ActivityThread.main(ActivityThread.java:5041)
08-02 20:48:37.443: E/AndroidRuntime(3575): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 20:48:37.443: E/AndroidRuntime(3575): at java.lang.reflect.Method.invoke(Method.java:511)
08-02 20:48:37.443: E/AndroidRuntime(3575): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
08-02 20:48:37.443: E/AndroidRuntime(3575): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
08-02 20:48:37.443: E/AndroidRuntime(3575): at dalvik.system.NativeStart.main(Native Method)
08-02 20:48:37.443: E/AndroidRuntime(3575): Caused by: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:424)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:50)
08-02 20:48:37.443: E/AndroidRuntime(3575): at com.example.note.NoteEdit.populateFields(NoteEdit.java:231)
08-02 20:48:37.443: E/AndroidRuntime(3575): at com.example.note.NoteEdit.onCreate(NoteEdit.java:99)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.app.Activity.performCreate(Activity.java:5104)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
The output in Logcat should be read from top(in your case, FATAL EXCEPTION: main onwards). However, you need to find how your activity contributes to the error. In most cases(and definitely not all), you will find Logcat informing you about a line of code inside the scope of your app. This is where the exception originated:
08-02 20:48:37.443: E/AndroidRuntime(3575): Caused by: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:424)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
08-02 20:48:37.443: E/AndroidRuntime(3575): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:50)
-------->>>>>>>>> 08-02 20:48:37.443: E/AndroidRuntime(3575): at com.example.note.NoteEdit.populateFields(NoteEdit.java:231)
After this, the error propagates towards the top before reaching:
08-02 20:48:37.443: E/AndroidRuntime(3575): FATAL EXCEPTION: main
08-02 20:48:37.443: E/AndroidRuntime(3575): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.note/com.example.note.NoteEdit}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
Another thing to be careful about: exceptions don't always occur independently. You can have several exceptions stacked up. In this case, find the exception that is thrown first(lowest in the Logcat output) and work your way to the top.
I know there's lot's of these questions, and "solution" is make sure that Android Private Libraries are checked. In my case they are, any other hints? App crash at very beginning.
Here goes stack trace
08-02 00:22:58.316: E/Trace(4825): error opening trace file: No such file or directory (2)
08-02 00:22:59.035: W/dalvikvm(4825): VFY: unable to find class referenced in signature (Landroid/support/v4/app/Fragment;)
08-02 00:22:59.035: W/dalvikvm(4825): VFY: unable to find class referenced in signature (Landroid/support/v4/app/Fragment;)
08-02 00:22:59.045: I/dalvikvm(4825): Could not find method android.support.v4.content.LocalBroadcastManager.getInstance, referenced from method com.facebook.Session.postActiveSessionAction
08-02 00:22:59.045: W/dalvikvm(4825): VFY: unable to resolve static method 187: Landroid/support/v4/content/LocalBroadcastManager;.getInstance (Landroid/content/Context;)Landroid/support/v4/content/LocalBroadcastManager;
08-02 00:22:59.045: D/dalvikvm(4825): VFY: replacing opcode 0x71 at 0x0009
08-02 00:22:59.075: D/AndroidRuntime(4825): Shutting down VM
08-02 00:22:59.075: W/dalvikvm(4825): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
08-02 00:22:59.095: E/AndroidRuntime(4825): FATAL EXCEPTION: main
08-02 00:22:59.095: E/AndroidRuntime(4825): java.lang.NoClassDefFoundError: android.support.v4.content.LocalBroadcastManager
08-02 00:22:59.095: E/AndroidRuntime(4825): at com.facebook.Session.postActiveSessionAction(Session.java:1215)
08-02 00:22:59.095: E/AndroidRuntime(4825): at com.facebook.Session.setActiveSession(Session.java:765)
08-02 00:22:59.095: E/AndroidRuntime(4825): at com.facebook.Session.openActiveSession(Session.java:865)
08-02 00:22:59.095: E/AndroidRuntime(4825): at com.facebook.Session.openActiveSession(Session.java:805)
08-02 00:22:59.095: E/AndroidRuntime(4825): at com.example.firstandroidapp.MainActivity.onCreate(MainActivity.java:22)
08-02 00:22:59.095: E/AndroidRuntime(4825): at android.app.Activity.performCreate(Activity.java:5104)
08-02 00:22:59.095: E/AndroidRuntime(4825): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
08-02 00:22:59.095: E/AndroidRuntime(4825): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
08-02 00:22:59.095: E/AndroidRuntime(4825): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
08-02 00:22:59.095: E/AndroidRuntime(4825): at android.app.ActivityThread.access$600(ActivityThread.java:141)
08-02 00:22:59.095: E/AndroidRuntime(4825): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
08-02 00:22:59.095: E/AndroidRuntime(4825): at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 00:22:59.095: E/AndroidRuntime(4825): at android.os.Looper.loop(Looper.java:137)
08-02 00:22:59.095: E/AndroidRuntime(4825): at android.app.ActivityThread.main(ActivityThread.java:5041)
08-02 00:22:59.095: E/AndroidRuntime(4825): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 00:22:59.095: E/AndroidRuntime(4825): at java.lang.reflect.Method.invoke(Method.java:511)
08-02 00:22:59.095: E/AndroidRuntime(4825): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
08-02 00:22:59.095: E/AndroidRuntime(4825): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
08-02 00:22:59.095: E/AndroidRuntime(4825): at dalvik.system.NativeStart.main(Native Method)
Solved. From some odd reason ADT preconfigured by google attached same file in /libs directory of project. When you add facebook SDK to class path it attaches it as well. Problem is they have diffrent versions (and sha-1 hash) so eclipse had problem what to do. I just remove /libs directory and it worked. Runs app from facebook tutorial successfully.
I am implementing the system andEngine multiplayer for first, then be able to adjust all imports and libraries and runs without any error in MOTODEV, but the emulator "has stopped unexpectedly".
You can see code here.
Error on emulator:
08-02 00:52:55.500: D/AndroidRuntime(330): Shutting down VM
08-02 00:52:55.500: W/dalvikvm(330): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-02 00:52:55.549: E/AndroidRuntime(330): FATAL EXCEPTION: main
08-02 00:52:55.549: E/AndroidRuntime(330): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.multiplayerand/com.multiplayerand.MainActivity}: java.lang.ClassNotFoundException: com.multiplayerand.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.multiplayerand-2.apk]
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.os.Looper.loop(Looper.java:123)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.reflect.Method.invoke(Method.java:521)
08-02 00:52:55.549: E/AndroidRuntime(330): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-02 00:52:55.549: E/AndroidRuntime(330): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-02 00:52:55.549: E/AndroidRuntime(330): at dalvik.system.NativeStart.main(Native Method)
08-02 00:52:55.549: E/AndroidRuntime(330): Caused by: java.lang.ClassNotFoundException: com.multiplayerand.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.multiplayerand-2.apk]
08-02 00:52:55.549: E/AndroidRuntime(330): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
08-02 00:52:55.549: E/AndroidRuntime(330): ... 11 more
Pay attention to this line from your log:
Unable to instantiate activity ComponentInfo{com.multiplayerand/com.multiplayerand.MainActivity}: java.lang.ClassNotFoundException: com.multiplayerand.MainActivity in loader dalvik.system.PathClassLoader
That line says,you tried to instantiate activity that it's name is MainActivity and it would be in com.multiplayerand pakage,but system could not find any Activity with this Component-info,and so java.lang.ClassNotFoundException has been occurred.
I guess you can solve problem if you:
Check that your Activity name be MainActivity.
Check that MainActivity be in package with name com.multiplayerand.
Check that you registered MainActivity in manifest of your project.
This question already has answers here:
Closed 10 years ago.
I created a new Android project, using Guice to inject a class; But when I run it, I get a ClassNotFoundException.
The Exception happened after I updated the Android plugin to the latest version in Eclipse,
Version:
jdk-6u33-windows-x64
guice-2.0-no_aop
Android 2.1
Code:
public class TextApplication{>....
public void onCreate() {
super.onCreate();
singleton = this;
this.in = Guice.createInjector(new BaseModule()); //Exception happens
........
}
public class BaseModule implements Module {
#Override
public void configure(Binder binder) {
binder.bind(ServiceRequest.class).in(Scopes.SINGLETON);
binder.bind(TService.class).in(Scopes.SINGLETON);
.......
}
}
Log:
08-02 16:28:26.646: E/dalvikvm(18212): Could not find class
'[Lcom.google.inject.Module;', referenced from method
com.shuyou.shop.TextApplication.onCreate 08-02 16:28:26.656:
W/dalvikvm(18212): VFY: unable to resolve new-array 588
([Lcom/google/inject/Module;) in Lcom/shuyou/shop/TextApplication;
08-02 16:28:26.656: W/dalvikvm(18212): threadid=1: thread exiting with
uncaught exception (group=0x2aacc8a0) 08-02 16:28:26.666:
E/AndroidRuntime(18212): FATAL EXCEPTION: main 08-02 16:28:26.666:
E/AndroidRuntime(18212): java.lang.NoClassDefFoundError:
[Lcom.google.inject.Module; 08-02 16:28:26.666:
E/AndroidRuntime(18212): at
com.shuyou.shop.TextApplication.onCreate(TextApplication.java:27)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4286)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.app.ActivityThread.access$3000(ActivityThread.java:132) 08-02
16:28:26.666: E/AndroidRuntime(18212): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2109)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.os.Handler.dispatchMessage(Handler.java:99) 08-02
16:28:26.666: E/AndroidRuntime(18212): at
android.os.Looper.loop(Looper.java:123) 08-02 16:28:26.666:
E/AndroidRuntime(18212): at
android.app.ActivityThread.main(ActivityThread.java:4669) 08-02
16:28:26.666: E/AndroidRuntime(18212): at
java.lang.reflect.Method.invokeNative(Native Method) 08-02
16:28:26.666: E/AndroidRuntime(18212): at
java.lang.reflect.Method.invoke(Method.java:521) 08-02 16:28:26.666:
E/AndroidRuntime(18212): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634) 08-02
16:28:26.666: E/AndroidRuntime(18212): at
dalvik.system.NativeStart.main(Native Method)
BaseModule should extend AbstractModule not implement Module.
See this answer:
ClassNotFoundException with Guice 2.0
It seems you're missing a JAR in your project.
Download:
I would suggest you check that you have correctly added the required jar to your buildpath.
am working on an android application, for the login part there's no error detected on eclipse, but the connection is not established with the mySQL database. here's the log file
08-02 16:25:58.063: I/global(236): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
08-02 16:25:58.074: W/System.err(236): org.json.JSONException: A JSONObject text must begin with '{' at character 1 of <br />
08-02 16:25:58.084: W/System.err(236): <b>Parse error</b>: syntax error, unexpected '{' in <b>C:\Program Files\EasyPHP-12.0\www\Android\Connection.php</b> on line <b>36</b><br />
08-02 16:25:58.093: W/System.err(236): at org.json.JSONTokener.syntaxError(JSONTokener.java:448)
08-02 16:25:58.093: W/System.err(236): at org.json.JSONObject.<init>(JSONObject.java:178)
08-02 16:25:58.103: W/System.err(236): at org.json.JSONObject.<init>(JSONObject.java:246)
08-02 16:25:58.113: W/System.err(236): at com.stage.sondage.Login.onClick(Login.java:128)
08-02 16:25:58.124: W/System.err(236): at android.view.View.performClick(View.java:2364)
08-02 16:25:58.124: W/System.err(236): at android.view.View.onTouchEvent(View.java:4179)
08-02 16:25:58.124: W/System.err(236): at android.widget.TextView.onTouchEvent(TextView.java:6540)
08-02 16:25:58.143: W/System.err(236): at android.view.View.dispatchTouchEvent(View.java:3709)
08-02 16:25:58.143: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.153: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.153: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.163: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.163: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.163: W/System.err(236): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
08-02 16:25:58.163: W/System.err(236): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
08-02 16:25:58.186: W/System.err(236): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
08-02 16:25:58.203: W/System.err(236): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
08-02 16:25:58.213: W/System.err(236): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
08-02 16:25:58.213: W/System.err(236): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
08-02 16:25:58.223: W/System.err(236): at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 16:25:58.250: W/System.err(236): at android.os.Looper.loop(Looper.java:123)
08-02 16:25:58.253: W/System.err(236): at android.app.ActivityThread.main(ActivityThread.java:4363)
08-02 16:25:58.253: W/System.err(236): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 16:25:58.253: W/System.err(236): at java.lang.reflect.Method.invoke(Method.java:521)
08-02 16:25:58.253: W/System.err(236): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-02 16:25:58.253: W/System.err(236): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-02 16:25:58.253: W/System.err(236): at dalvik.system.NativeStart.main(Native Method)
08-02 16:25:58.273: I/NotificationService(60): enqueueToast pkg=com.stage.sondage callback=android.app.ITransientNotification$Stub$Proxy#44e77500 duration=0
I hope to hear from good tips soon. Thank you for reading my question.
-Asmae
Without seeing the offending code it's hard to say without any real certainty, but the error looks like its coming from the page itself. Make sure you are connecting to the right url and giving it all the parameters. The fact that its getting to the JSON parsing suggests that it is at least connecting to the site.
this error
<b>Parse error</b>: syntax error, unexpected '{' in <b>C:\Program Files\EasyPHP-12.0\www\Android\Connection.php</b> on line <b>36</b><br />
is almost definitely from php itself.