Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

New Forums: Nexus 6 | Nexus Player | Nexus 9
test: Reply
 
LinkBack Thread Tools
Old February 8th, 2012, 02:20 PM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Feb 2012
Posts: 22
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Question Some help please with Eclipse

Hello all, I am very new to programming and learning to build android apps is pretty much the first thing I have done.

Having got over the initial frustration of not being able to get anything to work I have made some progress on a couple of apps. Both involve an EditText for the user to enter a number, and a button which takes the number, multiplies it by another number and then changes a TextView to give the answer.

It was working perfectly until I started messing around with it and trying to make it do something useful. Now whenever I run the app I get '"app name" has stopped working' on the emulator. The version is Android 4.0.

Any help at all would be appreciated, thank you

Advertisements
ktUK is offline  
Last edited by ktUK; February 8th, 2012 at 02:43 PM.
Reply With Quote
sponsored links
Old February 9th, 2012, 02:07 AM   #2 (permalink)
Member
 
Join Date: Aug 2010
Location: Norway
Posts: 313
 
Device(s): Samsung Galaxy Nexus
Carrier: Not Provided

Thanks: 0
Thanked 53 Times in 51 Posts
Default

We need more info than that. Tell us what you're trying to do, and also post the exception thrown in logcat
miXer is offline  
Reply With Quote
Old February 9th, 2012, 03:49 AM   #3 (permalink)
Junior Member
 
Valten1992's Avatar
 
Join Date: Feb 2012
Location: Ireland
Posts: 43
 
Device(s): Samsung Galaxy mini
Carrier: Not Provided

Thanks: 6
Thanked 3 Times in 3 Posts
Default

When that happens, it means their is a flaw in your code logic, have you tried reverting to an earlier version? Logcat will tell you where you went wrong.
Valten1992 is offline  
Reply With Quote
Old February 9th, 2012, 04:32 AM   #4 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Feb 2012
Posts: 22
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default

Thanks I will post the logcat error when I get home
ktUK is offline  
Reply With Quote
Old February 10th, 2012, 01:04 PM   #5 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Feb 2012
Posts: 22
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default

Okay here's the logcat once the app is uploaded to the emulator



02-10 18:59:58.929: D/dalvikvm(559): Not late-enabling CheckJNI (already on)
02-10 19:00:00.308: D/AndroidRuntime(559): Shutting down VM
02-10 19:00:00.308: W/dalvikvm(559): threadid=1: thread exiting with uncaught exception (group=0x409951f8)
02-10 19:00:00.518: E/AndroidRuntime(559): FATAL EXCEPTION: main
02-10 19:00:00.518: E/AndroidRuntime(559): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{converter.units.kitchen/converter.units.kitchen.menu}: java.lang.ClassNotFoundException: converter.units.kitchen.menu
02-10 19:00:00.518: E/AndroidRuntime(559): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1879)
02-10 19:00:00.518: E/AndroidRuntime(559): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:1980)
02-10 19:00:00.518: E/AndroidRuntime(559): at android.app.ActivityThread.access$600(ActivityThre ad.java:122)
02-10 19:00:00.518: E/AndroidRuntime(559): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1146)
02-10 19:00:00.518: E/AndroidRuntime(559): at android.os.Handler.dispatchMessage(Handler.java:99 )
02-10 19:00:00.518: E/AndroidRuntime(559): at android.os.Looper.loop(Looper.java:137)
02-10 19:00:00.518: E/AndroidRuntime(559): at android.app.ActivityThread.main(ActivityThread.jav a:4340)
02-10 19:00:00.518: E/AndroidRuntime(559): at java.lang.reflect.Method.invokeNative(Native Method)
02-10 19:00:00.518: E/AndroidRuntime(559): at java.lang.reflect.Method.invoke(Method.java:511)
02-10 19:00:00.518: E/AndroidRuntime(559): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:784)
02-10 19:00:00.518: E/AndroidRuntime(559): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:551)
02-10 19:00:00.518: E/AndroidRuntime(559): at dalvik.system.NativeStart.main(Native Method)
02-10 19:00:00.518: E/AndroidRuntime(559): Caused by: java.lang.ClassNotFoundException: converter.units.kitchen.menu
02-10 19:00:00.518: E/AndroidRuntime(559): at dalvik.system.BaseDexClassLoader.findClass(BaseDex ClassLoader.java:61)
02-10 19:00:00.518: E/AndroidRuntime(559): at java.lang.ClassLoader.loadClass(ClassLoader.java:5 01)
02-10 19:00:00.518: E/AndroidRuntime(559): at java.lang.ClassLoader.loadClass(ClassLoader.java:4 61)
02-10 19:00:00.518: E/AndroidRuntime(559): at android.app.Instrumentation.newActivity(Instrument ation.java:1023)
02-10 19:00:00.518: E/AndroidRuntime(559): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1870)
02-10 19:00:00.518: E/AndroidRuntime(559): ... 11 more

I have no idea where all this came from as I had it working fine when multiplying two integers together, I then tried to make 3 seperate outputs with different multipliers and this happened. Another app also stops working as soon as it uploads, could there be a more general problem?

Thank you in advance for your help
ktUK is offline  
Reply With Quote
Old February 10th, 2012, 03:03 PM   #6 (permalink)
Member
 
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 191
 
Device(s): Galaxy Nexus GSM
Carrier: Not Provided

Thanks: 2
Thanked 37 Times in 33 Posts
Default

Quote:
Originally Posted by ktUK View Post
02-10 19:00:00.518: E/AndroidRuntime(559): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{converter.units.kitchen/converter.units.kitchen.menu}: java.lang.ClassNotFoundException: converter.units.kitchen.menu
This is the critical line. It's saying that Android is trying to start an activity converters.units.kitchen.menu, but that class doesn't exist.

This is a symptom of a misconfiguration in your AndroidManifest.xml. (One of) your activities in this XML file will have MAIN action and LAUNCHER category its intent filter. This activity is the one that launches when a user taps your app from the launcher. The android:name attribute of this activity is currently "converter.units.kitchen.menu", or possibly ".menu" with the package attribute of the root manifest element being "converter.units.kitchen". You don't have a menu class (case sensitive) in the converter.units.kitchen package.

Either change AndroidManifest.xml to match your code, or change your code to match AndroidManifest.xml.
jiminaus is offline  
Reply With Quote
The Following User Says Thank You to jiminaus For This Useful Post:
ktUK (February 11th, 2012)
Old February 11th, 2012, 04:00 AM   #7 (permalink)
Member
 
Join Date: Aug 2010
Location: Norway
Posts: 313
 
Device(s): Samsung Galaxy Nexus
Carrier: Not Provided

Thanks: 0
Thanked 53 Times in 51 Posts
Default

If you haven't messed around with your activities you can try Project -> Clean in eclipse. This will rebuild your app.
miXer is offline  
Reply With Quote
Old February 11th, 2012, 06:59 AM   #8 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Feb 2012
Posts: 22
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default Thank you for sorting that, a different niggle now though..

Thank you both for your help, with which I have been able to get the app working on the emulator again.

An error I get often when first starting a build, but an app I've been working on for a while is now plagued with too is

'R cannont be resolved to a variable'

in all the java files. It seems to come out of nowhere and I often have to paste all my code into a new project to get rid of it. I know it has been asked before on forums because I must have read nearly all of the posts! I have tried putting

//import android.R;

which does work sometimes but didn't today.

Sorry if this is a regularly asked question with a simple answer but I have done a lot of searching around for an answer all ready.

Thank you in anticipation
ktUK is offline  
Reply With Quote
Old February 11th, 2012, 10:46 AM   #9 (permalink)
Member
 
Join Date: Aug 2010
Location: Norway
Posts: 313
 
Device(s): Samsung Galaxy Nexus
Carrier: Not Provided

Thanks: 0
Thanked 53 Times in 51 Posts
Default

If R cannot be resolved to a variable, you have errors in your project, most likely in some xml file.
miXer is offline  
Reply With Quote
Old February 12th, 2012, 04:58 AM   #10 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Feb 2012
Posts: 22
 
Device(s):
Carrier: Not Provided

Thanks: 4
Thanked 0 Times in 0 Posts
Default

I fixed it by altering the CATEGORY in the manifest which I think was for some reason missing some words, not that I know why this should have caused that error.

Thanks
ktUK is offline  
Reply With Quote
sponsored links
Reply
Tags
eclipse, emulator, error, stopped, working


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:02 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.