I just changed the main activity name after creating the app and updated the same in Manifest file.
But now the app is getting built without any error, its not at all getting launched. Here is what i get as output in eclips
[2012-05-05 21:32:12 - Test] Performing sync [2012-05-05
21:32:12 - Test] Automatic Target Mode: Preferred AVD
'Test_G' is available on emulator 'emulator-5554' [2012-05-05 21:32:12
- Test] Uploading Test.apk onto device 'emulator-5554' [2012-05-05 21:32:12 - Test] Installing Test.apk...
[2012-05-05 21:32:15 - Test] Success! [2012-05-05
21:32:16 - Test] \Test\binTest.apk installed on device
[2012-05-05 21:32:16 - Test] Done!
How to solve this
Manifest.xml
?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity android:name="contactListTab"></activity>
</application>
</manifest>
You haven't provided the intent category. Try adding
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Between the acitivity tags!
Your activity declaration isn't saying it should be the first activity that should be opened after the app starts to do this you have to add the intent filters and you're activity name should be . because it's a java file in the package. And as mentioned in the other answer you have to set the package="" to the package name of your app.
Try changing your manifest to this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="-->PACKAGE NAME<--"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity android:name=".contactListTab">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Ensure the activityname is contactListTab!
package="Test"
Instead of Test, put the package where your Activity resides. Also make sure contactListTab is your Activity.
I suggest you declaring such strings in your res/strings.xml file instead of having them here. This way changing them is easier.
Related
I'm going throught the tutorial on developer.android.com and I've gotten to the point where it wants me to run the program. I right click on the project in the project explorer, go to run as and click android application. The console displays the following
[2014-06-27 15:15:23 - myFirstApp] Android Launch!
[2014-06-27 15:15:23 - myFirstApp] adb is running normally.
[2014-06-27 15:15:23 - myFirstApp] No Launcher activity found!
[2014-06-27 15:15:23 - myFirstApp] The launch will only sync the application package on the device!
[2014-06-27 15:15:23 - myFirstApp] Performing sync
[2014-06-27 15:15:23 - myFirstApp] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
If you need to see the androidmanifest.xml file, here it is
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
</application>
</manifest>
You are missing activity tag like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
***<activity
android:name="com.example.myfirstapp.YourActivity"
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>
When I try to create a new Android project and run it it did not appear on the emulator.
This is the console message :
[2014-04-12 00:30:57 - Fir] Android Launch!
[2014-04-12 00:30:57 - Fir] adb is running normally.
[2014-04-12 00:30:57 - Fir] Performing com.example.fir.MainActivity activity launch
[2014-04-12 00:31:05 - Fir] Uploading Fir.apk onto device 'emulator-5554'
[2014-04-12 00:31:06 - Fir] Installing Fir.apk...
[2014-04-12 00:31:22 - Fir] Success!
[2014-04-12 00:31:22 - Fir] Starting activity com.example.fir.MainActivity on device emulator-5554
I wait more than one hour and its not appear? And I try to kill-server adb and start it again, but still the same problem.
Please help...
Try the genymotion Emulator. It is faster than the normal android Emulator.
Can you post your manifest.xml?
This is my manifest.xml ,And i will try the genymotion Emulator
` <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.fir"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.fir.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>`
I'm new just working with some basic Android codes. My problem is that Android Emulator is not showing any output when I run code. It takes really long and on console it sticks here
[2013-03-31 03:17:55 - Helloworld] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.helloworld/.MainActivity }
and emulator looks like this
I have waited for 5-10 minutes but it does not show output. Please guide me where the problem might be. I downloaded sdk ADT Bundle for Windows and configured it as mentioned in official site.
In Eclipse, try :
Window -> Show View -> Other -> Android/Devices
Select the Emulator from the newly added Devices window, and check back your logcat.
I'd try a little debug, and set a break point on the very first line of code in your app's main activity. Then I'd step thru and see where it breaks.
I've just encountered the similar problem, in my case I forgot to add the activity in AndroidManifest.xml file.
The following is my Manifest file for example ...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testalarm"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="10" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.testalarm.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>
<activity
android:name="com.example.testalarm.CheckpointActivity" >
<intent-filter>
<action android:name="com.example.testalarm.CheckpointActivity" />
</intent-filter>
</activity>
</application>
</manifest>
Check if you have all required activities as <activity> under <application>
I am learning Android and can not get my program to show up in the program listings drawer of my Nexus S emulated device. When I load up the emulator, it does load my program successfully, after hitting "run new configuration". I know there are a ton of threads on this...but from what I can tell I have everything right in my manifest with:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Also, to be clear the run configuration in Eclipse does run my program successfully. It's just not in the apps menu/drawer of the emulated device to click and run:
[2013-03-07 20:14:04 - TodDoList] New emulator found: emulator-5554
[2013-03-07 20:14:04 - TodDoList] Waiting for HOME ('android.process.acore') to be launched...
[2013-03-07 20:14:46 - TodDoList] HOME is up on device 'emulator-5554'
[2013-03-07 20:14:46 - TodDoList] Uploading TodDoList.apk onto device 'emulator-5554'
[2013-03-07 20:14:47 - TodDoList] Installing TodDoList.apk...
[2013-03-07 20:15:23 - TodDoList] Success!
[2013-03-07 20:15:23 - TodDoList] Starting activity com.paad.toddolist.ToDoListActivity on device emulator-5554
[2013-03-07 20:15:24 - TodDoList] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.paad.toddolist/.ToDoListActivity }
Here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.paad.toddolist"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="15" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.paad.toddolist.ToDoListActivity"
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>
Here is my strings.xml file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">TodDoList</string>
<string name="addItemHint">New To Do List</string>
<string name="addItemContentDescription">New To Do Item</string>
</resources>
Try replacing
android:name="com.paad.toddolist.ToDoListActivity"
with
android:name=".ToDoListActivity"
I am trying to run the emulator and each time I tried it it gives me the same error message 'Application stopped unexpectedly' I tried sorting it by killing the adb process in the task manager. The log cat error says:
WARNING: Application does not specify an API level requirement!
Device API version is 7 (Android 2.1-update1)
I do not know how this could be sorted, or if there is any other issue.
Please help, thanks!
Amrita
I guess the solution for your problem is:
In your manifest there should be something like this
<uses-sdk android:minSdkVersion="int" />
Now just change the number to the desired version number. Additionally you should also change the value of the target in the default.properties file.
AdnroidManifest.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jaxx.progressbarexample"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<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>
**<uses-sdk android:minSdkVersion="9" />**
</manifest>
One more thing to remind,you specify the min sdk version in your AndroidManifest.xml file similar to what your emulator target sdk version which you specify while creating your AVD.or create a new AVD with a target sdk of your application
.