I need to use actionbarsherlock in my test project. Here is my activity:
public class MainActivity extends SherlockActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
#Override
public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) {
// TODO Auto-generated method stub
return super.onCreateOptionsMenu(menu);
}
}
and this is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.actionbarsherlocktest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.actionbarsherlocktest.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>
but when I run as an android application, it is said:
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.actionbarsherlock.R$styleable
at com.actionbarsherlock.internal.ActionBarSherlockCompat.generateLayout(ActionBarSherlockCompat.java:998)
at com.actionbarsherlock.internal.ActionBarSherlockCompat.installDecor(ActionBarSherlockCompat.java:915)
at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:849)
at com.actionbarsherlock.app.SherlockActivity.setContentView(SherlockActivity.java:229)
at com.example.actionbarsherlocktest.MainActivity.onCreate(MainActivity.java:12)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
can someone help me?
This seems to be a problem in how you have your project and its libraries configured. The compiler is unable to find the auto generated R class for ABS which probably means it's just not being generated. You should try reimporting ABS into your project. This video on how to get started with the library might help: http://www.youtube.com/watch?v=4GJ6yY1lNNY.
Have you imported the libraries properly?
Well try this ! this might help you:
Libraries do not get added to APK anymore after upgrade to ADT 22
Related
I have some requirements where I should run the test project anytime on my device, without connecting it to system and running through eclipse.
I added some intent-filter to my AndroidManifest.xml to make the test project visible on the launcher, however, it never runs successfully and is not able to find the target activity class
Meanwhile, If I connect the device to system, and from eclipse perform Run As Android Junit , it runs successfully without any exception. So what is wrong here? Am i missing some concept ?
Below is the AndroidManifest.xml of my test application
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.org.search.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="18"/>
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.third.party.packageName" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<uses-library android:name="android.test.runner" />
<activity android:name="com.org.search.test.MyTestClass">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
And here is the exception log
java.lang.ExceptionInInitializerError
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1130)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2183)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316)
at android.app.ActivityThread.access$600(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:5225)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException:
com.third.party.packageName.SearchActivity
at com.expedia.search.test.ExpediaHotelsScraper.<clinit>(ExpediaHotelsScraper.java:35)
... 15 more
Caused by: java.lang.ClassNotFoundException: com.third.party.packageName.SearchActivity
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:204)
at java.lang.Class.forName(Class.java:169)
at com.org.search.test.MyTestClass.<clinit>(MyTestClass.java:32)
... 15 more
Caused by: java.lang.NoClassDefFoundError: com/third/party/packageName/activity/SearchActivity
... 19 more
Caused by: java.lang.ClassNotFoundException: Didn't find class
"com.third.party.packageName.SearchActivity" on path:
DexPathList[[zip file "/system/framework/android.test.runner.jar",
zip file "/data/app/com.org.search.test-1.apk"],
nativeLibraryDirectories=[/data/app-lib/com.org.search.test-1,
/vendor/lib, /system/lib]]
Also the test class code MyTestClass.java
public class MyTestClass extends ActivityInstrumentationTestCase2 {
private static final String LAUNCH_ACTIVITY_NAME =
"com.third.party.packageName.activity.SearchActivity";
private Solo solo;
private static Class<?> splashActivityClass;
static {
try {
splashActivityClass = Class.forName(LAUNCH_ACTIVITY_NAME);
}
catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
public MyTestClass() throws ClassNotFoundException {
super(splashActivityClass);
}
#Override
protected void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity());
}
public void testAllCountries() {
//my test goes here
}
I am new to android automation. Please help me understand the concept if am trying something infeasible.
You should read Android Testing: running tests from code which would help you in achieving your objective.
i am running one android application in which i am using ActionBar but from supported library for android 2.2
i have added two external jar file as a support libraries
android-support-v7-appcompact.jar
android-support-v13.jar
but when i run the sample in my device i getting following runtime error
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.example.android.navigationdrawerexample/com.example.android.navigationdrawerexample.NavMainActivity}:
java.lang.ClassNotFoundException:
com.example.android.navigationdrawerexample.NavMainActivity in loader
dalvik.system.PathClassLoader[/data/app/com.example.android.navigationdrawerexample-1.apk]
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2703)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2797)
at android.app.ActivityThread.access$2300(ActivityThread.java:135)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2132)
at android.os.Handler.dispatchMessage(Handler.java:99) at
android.os.Looper.loop(Looper.java:143) at
android.app.ActivityThread.main(ActivityThread.java:4914) at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:521) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at
dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.example.android.navigationdrawerexample.NavMainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.android.navigationdrawerexample-1.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at android.app.Instrumentation.newActivity(Instrumentation.java:1033)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2695)
here is the menifest file content
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.navigationdrawerexample"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<application
android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
>
<activity android:name="NavMainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
order of jar files
You should not only look at errors but also at warnings (orange text color in eclipse logcat view). Dalvik class loading are often preceded by some interesting informations about why a class can't be loaded by the Dalvik, something like a super class not existing.
I am trying to get Google Maps Android API v2 working on Android 2.2 on a HTC Desire.
My main.xml contains the following:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dk.sw510e13.user"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="dk.sw510e13.user.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>
This is my activity.
package dk.sw510e13.user;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
public class MainActivity extends FragmentActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
When I run the application, I will get the following exception. It seems that it cannot find SupportMapFragment, however, I believe that I have both the support library and Google Play Services as dependencies. When creating the project in Android Studio I chose to add support for fragments.
01-17 23:52:55.237 2557-2557/dk.sw510e13.user E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{dk.sw510e13.user/dk.sw510e13.user.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)
at android.app.ActivityThread.access$2300(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:144)
at android.app.ActivityThread.main(ActivityThread.java:4937)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class fragment
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:582)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
at android.app.Activity.setContentView(Activity.java:1654)
at dk.sw510e13.user.MainActivity.onCreate(MainActivity.java:13)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)
... 11 more
Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.SupportMapFragment: make sure class name exists, is public, and has an empty constructor that is public
at android.support.v4.app.Fragment.instantiate(Fragment.java:409)
at android.support.v4.app.Fragment.instantiate(Fragment.java:377)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:277)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:558)
... 20 more
Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.SupportMapFragment in loader dalvik.system.PathClassLoader[/data/app/dk.sw510e13.user-2.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
at android.support.v4.app.Fragment.instantiate(Fragment.java:399)
... 23 more
This is what I have in my dependencies.
Can anyone tell me what I am doing wrong?
UPDATE
This is my manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dk.sw510e13.user"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- The following two permissions are not required to use Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="dk.sw510e13.user.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>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="XXXXXX"/>
</application>
</manifest>
This is the problem that seems to be occurred when missing Google Play services.
I request you to please follow the steps mentioned below to get the Google Play services to be included in your application.
copying the google-play-services.jar in libs folder and set in the build path of eclipse is a wrong method.
import Google Play services in your project and add it in workspace.
from location of your SDK folder.
\extras\google\google_play_services\libproject\google-play-services_lib
2! Now you added Google Play Services to your work space, we have to create a reference
from our project to this library. Right-Click your project and choose “Properties” go
to the Android section, in the lower part press the “Add…” button and add a reference
to that library. Your result should be as in the screen shot bellow:
adding Google Play services library
Please Add
<permission
android:name="com.anchit.locationapi.maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
in your manifest
I try to create a simple GoogleMap by Using Google Play Service and Google Maps API. But all the times I get errors...
I´m working with IntelliJ 12.1, here my full Code:
RecorderMap.java
package com.example.GPSApp;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
public class RecorderMap extends FragmentActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
}
}
map.xml
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.gms.maps.SupportMapFragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.GPSApp"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="16" />
<permission
android:name="com.example.GPSApp.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.newmapview.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-feature android:name="android.hardware.location.gps" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application android:label="#string/app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".RecorderMap"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar"/>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="XXX" />
</application>
</manifest>
I think the Problem is how I include the GooGlePlayService... I´ve tried to add as module, as libary as External Libary but I don't know how to include and to use it right... :(
EDIT:
LogCat
08-28 07:41:59.869: ERROR/AndroidRuntime(23080): FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.GPSApp/com.example.GPSApp.RecorderMap}: android.view.InflateException: Binary XML file line #2: Error inflating class com.google.android.gms.maps.SupportMapFragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class com.google.android.gms.maps.SupportMapFragment
at android.view.LayoutInflater.createView(LayoutInflater.java:508)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:210)
at android.app.Activity.setContentView(Activity.java:1660)
at com.example.GPSApp.RecorderMap.onCreate(RecorderMap.java:18)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
... 11 more
Caused by: java.lang.NoSuchMethodException: SupportMapFragment(Context,AttributeSet)
at java.lang.Class.getMatchingConstructor(Class.java:643)
at java.lang.Class.getConstructor(Class.java:472)
at android.view.LayoutInflater.createView(LayoutInflater.java:480)
... 20 more
****EDIT2**
Problem solved by using this: java.lang.noclassdeffounderror: com.google.android.gms.R$styleable**
The only thing I find missing in your RecorderMap.java file is that you haven't imported the SupportFragment class. So add this line to it
import com.google.android.gms.maps.SupportMapFragment;
If that doesn't work, then check out the following.
From what you are saying, it means you have already installed the google play services. If not, then try installing it using this link http://developer.android.com/google/play-services/setup.html
After that, referencing the google play services library should be as easy as editing your build.gradle file. The current version of android studio makes this possible. Under dependencies in your build.gradle file, add the following code
compile 'com.google.android.gms:play-services:3.1.36'
You seem to have your API key intact.
Finally, remember you need to test your app on an actual android device and not an emulator. The android API version 2 is not yet able to display maps on emulators.
I think this should be okay for your app to work.
I get the following error from the emulator in Eclipse when I run an Android application...
"The application has stopped unexpectedly. Please try again"
There are no error icons appearing in the project folder in Eclipse. I have already tried...
Cleaning the Project
Android Tools > Fix Project Properties
Updating the Build Path
My Error Log is saying...
"java.lang.RuntimeException: Unable to instantiate activity ComponentInfo..."
The Error Log goes onto say...
"Caused by: java.lang.ClassNotFoundException..."
Just to note that I do not have a "Build.xml" file in my project folder but instead a "apktool.yml" if this makes any difference.
Any suggestions??
EDIT:
Here's the manifest file...
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="61" android:versionName="1.2.2" package="com.__.__"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:label="#string/app_name" android:icon="#drawable/ic_launcher">
<activity android:label="#string/app_name" android:name=".MTActivity" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name=".RCActivity" android:screenOrientation="portrait" />
...
Errors generated LogCat...
E/AndroidRuntime(6220): FATAL EXCEPTION: main
E/AndroidRuntime(6220): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ir.mtools/com.ir.mtools.MTActivity}: java.lang.ClassNotFoundException:
com.irtza.pulmtools.MTActivity in loader dalvik.system.PathClassLoader[/data/app/com.ir.mtools-1.apk]
E/AndroidRuntime(6220): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
E/AndroidRuntime(6220): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
E/AndroidRuntime(6220): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime(6220): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
E/AndroidRuntime(6220): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(6220): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime(6220): at android.app.ActivityThread.main(ActivityThread.java:3687)
E/AndroidRuntime(6220): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(6220): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(6220): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
E/AndroidRuntime(6220): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
E/AndroidRuntime(6220): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(6220): Caused by: java.lang.ClassNotFoundException: com.ir.mtools.MTActivity in loader dalvik.system.PathClassLoader[/data/app/com.ir.mtools-1.apk]
Whenever this happens it means your application has encountered a runtime exception, which means no errors will show up at compile time. In this case I'm guessing you have not declared the activity in the AndroidManifest.xml file, but without seeing more code that's only a guess.
java.lang.ClassNotFoundException: com.ir.mtools.MTActivity
Is com.ir.mtools.MTActivity this part of some library? if so have you included it in your build path ?