0

I am getting the following errors while trying my first Android App of adding two numbers. Also these errors are appearing for the error of "unfortunately adder_test has stopped" on the AVD. I have already referred to such similar posts but am not able to get any clue for my problems.

06-05 14:01:18.850: E/libEGL(51): called unimplemented OpenGL ES API
06-05 14:01:18.860: E/libEGL(51): called unimplemented OpenGL ES API
06-05 14:01:18.860: E/libEGL(51): called unimplemented OpenGL ES API
06-05 14:01:18.860: E/libEGL(51): called unimplemented OpenGL ES API
06-05 14:01:18.860: E/SurfaceFlinger(51): glCheckFramebufferStatusOES error -450085546
06-05 14:01:18.860: E/SurfaceFlinger(51): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
06-05 14:01:18.860: E/libEGL(51): called unimplemented OpenGL ES API
06-05 14:01:18.860: E/libEGL(51): called unimplemented OpenGL ES API
06-05 14:01:22.400: E/AndroidRuntime(1493): FATAL EXCEPTION: main
06-05 14:01:22.400: E/AndroidRuntime(1493): Process: com.example.adder_test, PID: 1493
06-05 14:01:22.400: E/AndroidRuntime(1493): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.adder_test/com.example.adder_test.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.adder_test.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.adder_test-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.adder_test-1, /system/lib]]
06-05 14:01:22.400: E/AndroidRuntime(1493):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at android.os.Handler.dispatchMessage(Handler.java:102)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at android.os.Looper.loop(Looper.java:136)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at android.app.ActivityThread.main(ActivityThread.java:5017)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at java.lang.reflect.Method.invokeNative(Native Method)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at java.lang.reflect.Method.invoke(Method.java:515)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at dalvik.system.NativeStart.main(Native Method)
06-05 14:01:22.400: E/AndroidRuntime(1493): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.adder_test.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.adder_test-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.adder_test-1, /system/lib]]
06-05 14:01:22.400: E/AndroidRuntime(1493):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
06-05 14:01:22.400: E/AndroidRuntime(1493):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
06-05 14:01:22.400: E/AndroidRuntime(1493):     ... 11 more

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.adder_test"
android:versionCode="1"
android:versionName="1.0" >

<uses-feature android:glEsVersion="0x00020000"></uses-feature>
<uses-sdk android:targetSdkVersion="19" android:minSdkVersion="8"></uses-sdk>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        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>

MainActivity.java:

         import com.example.adder_test.R;

    import android.app.Activity;
import android.os.Bundle;
//import android.support.v7.appcompat.R;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends Activity { 
Button button1; 
EditText txtbox1,txtbox2; 
TextView tv; 



/** Called when the activity is first created. */ 
@Override 

public void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.activity_main); 
txtbox1= (EditText) findViewById(R.id.txtbox1); 
button1 = (Button) findViewById(R.id.button1); 
tv = (TextView) findViewById(R.id.lbl1); 
txtbox2= (EditText) findViewById(R.id.txtbox2); 
button1.setOnClickListener(new clicker()); 
} 
class clicker implements Button.OnClickListener 
{ 
public void onClick(View v) 
{ 
String a,b; 
Integer vis; 
a = txtbox1.getText().toString(); 
b = txtbox2.getText().toString(); 
vis = Integer.parseInt(a)+Integer.parseInt(b); 
tv.setText(vis.toString()); 
} 
} 
} 
Jongware
  • 22,200
  • 8
  • 54
  • 100
  • first format you question it is incredibly hard to read, second look at the error, you can see it cannot find one of your classes you reference `com.example.adder_test.MainActivity` – tyczj Jun 05 '14 at 18:40
  • First of all my apologies for the difficulty in reading. – user3712441 Jun 05 '14 at 18:44
  • What package is MainActivity in? – guycole Jun 05 '14 at 18:45
  • In this error message {Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.adder_test.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.adder_test-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.adder_test-1, /system/lib]]} I'm not getting about the DexPathList i.e. why it may search the .apk in DexPathList and how to solve it? – user3712441 Jun 05 '14 at 18:46
  • @guycole: It's in adder_test>src>MainActivity.java – user3712441 Jun 05 '14 at 18:50

1 Answers1

1

Thanks for the package name.

Your problem is that the source file is not located in the package promised in the manifest. The manifest promises com.example.adder_test so you need provide com.example.adder_test.MainActivity.java

Good luck.

guycole
  • 788
  • 5
  • 10
  • Thanks for pointing out.... :) It works but with following errors: – user3712441 Jun 05 '14 at 19:00
  • 06-05 14:58:03.130: E/InputDispatcher(384): channel 'b2d75778 com.example.adder_test/com.example.adder_test.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 06-05 14:58:03.130: E/InputDispatcher(384): channel 'b2f28d08 PopupWindow:b2d6c5e8 (server)' ~ Channel is unrecoverably broken and will be disposed! ......Any clues? – user3712441 Jun 05 '14 at 19:01
  • 1
    That is a different problem. Probably should post another question and this time include the layout XML (but not the manifest since you are past that). – guycole Jun 05 '14 at 19:02