I have installed a new setup of adb-bundle. When I run the project apk installed on device/emulator but not opens automatically. This problem is not related to coding I this it is related to eclipse setup because it happens with all projects. Please Help. Facing issue with debugging due to this problem.
Manifest.xml:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.demo.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>
Thanks
It seems like you have a problem with the adb. Open task manager and kill the adb process and restart everything and try again. If you have made some changes to the installed adb try to install it again properly.
Check the below links also,
https://lesleyharrison.wordpress.com/2011/01/15/solution-for-android-emulator-starts-but-app-doesnt-run/
Android application doesn't start from Eclipse
Related
I created a splash screen for my android application. In my AndroidManifest I set the SplashScreen Activity as Launcher and action as MAIN. After that I changed the HomeActivity's intentfilter.
Here is my android manifest file:
<application
android:allowBackup="true"
android:icon="#mipmap/icon"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".SplashScreenActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ActivityHome"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.ACTIVITHOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name=".Receivers.NetworkReceiver"></receiver>
</application>
I have both these activities inside the default package. Now, when I try to test the application in device, I get the following error:
Error while executing: am start -n "com.sdz.myapp/com.sdz.myapp.SplashScreenActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.sdz.myapp/.SplashScreenActivity }
Error type 3
Error: Activity class {com.sdz.myapp/com.sdz.myapp.SplashScreenActivity} does not exist.
Error while Launching activity
This is how my project structure looks like:
src
-com.sdz.myapp
----ActivityHome
----SplashScreenActivity
I restarted android studio but still the error is there. I dont know what is causing this.
I ran into this as well. I actually had to uninstall the apk from the device before it would work... which was really odd as the app wasn't showing up on my list of apps on the phone.
Here's what I did:
Opened up command line
Ran 'adb devices' to make sure my device was connected
ran 'adb uninstall ' Replace with "com.whatever.blah"
You should see a message saying it uninstall successfully
Try installing from Android Studio again and it should work
I have no idea how it gets in this weird state. :-/
Please change your android:name value at your activity tag with full name and first clean project . After that try to run your application again
<activity android:name="com.sdz.myapp.SplashScreenActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I have this same issue occasionally. The solution was to build the APK (menu "Build > Build APK") and install it manually in the phone. After that the error disappears.
I tried all of the above plus even delete the build folder and still did not work. The solution for me was: On your Android Studio go to File->Sync Project with Gradle Files
I have created My First Android Hello World on Android Studio . but when I run it on emulator , it is not running neither installing it on Emulator .. Every time is only shows session '' Error only in log .. i have done restart several times . no use ,
this is my emulator Setting
My Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.administrator.facebooklogin" >
<application
android:allowBackup="true"
android:icon="#mipmap/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>
I have changed the device and skins as well , but no use i have not found proper solution for session '' error .
Since you have just started, Explore Genymotion, a faster and better alternative to Android virtual devices for Android Development.
I am having issues with Eclipse. I'm new to Android development so I wouldn't be surprised if I messed something up along the way.
My app installs twice on my phone. When I click 'Run', Eclipse does the usual with installation, but when it is finished, the app shows up twice (ie. two separate icons) on my phone. Any ideas what the problem is?
In your manifest:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="com.myapp.FirstActivity"
android:theme="#style/Theme.Apptheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.myapp.SecondActivity"/>
</application>
make sure only your first activity has an intent-filter.
Uninstall both programs from the emulator. If you change the name of the program and/or change some of the settings, then it can install as a different program. My guess is after you do the install, then run that you'll only have the one icon.
Did you run two different versions of this code?
If so it will not save over the old icon but make a new one.
If this is the case trying deleting boths apps from the emulator and re-running it cleanly.
In my case I had two activities with the following intent-filter
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
I am unable to install my app onto a device even when it is downloaded from the Android Market. How can this be possible? If it were signed incorrectly wouldn't the market not accept it? I have tried to install it by isolating various activities but none seem to work even when I reduce it to a simple hello world application. The app has a tab view, two being webviews [one includes a reload button] and one tab that allows a user to send an email to a submission page. Does anyone have any ideas as to what I am missing?
Thank you all very much in advance.
EDIT:
It's being downloaded on the LG Ally running 2.2.2 and my app runs fine on an 2.2 emulator. It is compiled with a min level of 4. Here is my AndroidManifest file
<?xml version="1.0" encoding="utf-8"?>
<application android:icon="#drawable/icon" android:label="#string/app_name" android:debuggable="false">
<activity android:name=".BrotipsTabs"
android:label="Brotips">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".TabWidget"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".Random"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".Sub"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".BrotipsTabs" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<meta-data android:name="com.mobclix.APPLICATION_ID" android:value="<Key>"/>
<activity android:name="com.mobclix.android.sdk.MobclixBrowserActivity" android:theme="#android:style/Theme.Translucent.NoTitleBar"/>
</application>
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
By not working I mean it refuses to install and claims it never did while an icon remains on the phone.
Do you have any previous versions of your app installed on your phone? If you have an apk that is signed with the debug signature (which eclipse uses when you push run) and try to install it from the market which is signed with an actual signature then it will fail due to the two signatures being different. The message that it shows you is different on different devices I've found. If you have any previous versions of your app installed you should uninstall them and try to install from the market again. You should be good to go.
I have my Emulator open, and using Command Prompt I remove my application. I didn't closed the Emulator.
Then I go to Eclipse and hit Debug, but doesn't deploy the apk to the emulator, just tells me the package not yet registered with the system.
New package not yet registered with the system. Waiting 3 seconds before next attempt.
Restarting the emulator is not an option, as that takes 10-15 minutes.
What I am doing wrong?
I have encountered this occasionally. Doing a clean project before rebuilding and redeploying seems to do the trick.
This is eclipse (the point is eclipse can not run your app because can not start the right intent because can not find the right package) and one of the workaround of this is to rename your package in the manifest for example rename
package="com.hernblog.GreenThumbs"
to
package="com.hernblog.GreenThumbs1"
compile and build this, then put it back to the name you wanted
package="com.hernblog.GreenThumbs"
works as a charm :)
Clean and re-build may not help.
So, in that case remove the app from your device.
Then re-run your project on your device. That will help.
After trying many different solutions for this problem, I found that the line
<application android:debuggable="true" />
in my AndroidManifest was causing this problem.
Removing this line fixed it for me.
Note: You can still build with debugging mode without this line by using the ndk-build option NDK_DEBUG=1
im also having same problem.
I just commit my src,res folder in svn.
Then i check out new project from svn then it will works correctly.
Also check your "Enabled" option in manifest! Mine turned to off, somehow ..
I have also had this problem.
For me it was the fact that my launcher activity (the one with the Launch intent) did not have the "android:label" attribute
WRONG!!!
<application
android:icon="#drawable/icon"
android:label="#string/app_name">
<activity
android:name=".ui.SplashScreenActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.DashboardActivity"
android:label="#string/app_name">
</activity>
<activity android:name=".ui.LogListActivity"></activity>
</application>
RIGHT - Note the SplashScreenActivity
<application
android:icon="#drawable/icon"
android:label="#string/app_name">
<activity
android:name=".ui.SplashScreenActivity"
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=".ui.DashboardActivity"
android:label="#string/app_name">
</activity>
<activity android:name=".ui.LogListActivity"></activity>
</application>