Android app does not start (and is invisible!) on device - android

I have a strange problem with my Android app. When I start it from Netbeans, the app gets installed on my device (attached via USB). After that nothing happens. I also can't find the app anywhere on the device!! (no icon, no nothing).
Still I know the app has been installed, because under the android settings, where it says "Manage Applications" (or something) the app is now listed and I can uninstall it.
I've tried the whole procedure with a blank HelloWorld app, which worked fine. Here an icon got created o the device and the app was started correctly by NetBeans.
So I guess there is something wrong with my app causing it not to appear in the phone's launcher?
EDIT:
Here's the manifest:
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk android:minSdkVersion="4" />
<application
android:icon="#drawable/icon"
android:label="#string/app_name" android:debuggable="true">
</application>

you need to add below line in your Main activity in androidmanifest file
<activity android:label="#string/app_name"
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Related

Default Activity Not Found & App Not Showing in Launcher

I cleared all the bugs... Recently before running this app it was showing "No default activity found" I changed configuration to "Nothing" & also added Android Manifest.xml file.
After successful build, Emulator shows app in settings>>app management.
But,
There is nothing in Apps Menu. Even I tried manually installing this app in my device. But it says "App Not Installed"
Share your experience. Help me out. Thank you.
Please include all manifest functions into this code, if I am missing something. This app is cloud storage app.
This is my manifest file :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>```
Sometimes android studio has quircks and bugs.
In this case when it complains of activity not found even though you know it's there do the following:
clean build - see if it works
remove cable of device reattach cable of device - see if it works
restart android studio - see if it works
invalidate caches and restart - see if it works
if none of the above work, that means you have some place in that activity that in theory compiles, in practice there is a problem with it.
Add this in your activity tag
<category android:name="android.intent.category.DEFAULT" />

Android application installs but not launches [duplicate]

This question already has answers here:
My android app is not being displayed in the app drawer?
(3 answers)
Closed 8 years ago.
Before labeling this as a duplicate, please read. I have successfully installed an Android application I developed on Eclipse on to two different platforms: one emulator (Blue Stacks) and one actual device. Like I said, the app installs just fine on both platforms, but it doesn't appear on the list of apps that can be launched. When I go to settings, I can see the app on the list of installed applications, and it lets me uninstall it, but not open it. I've spent hours trying every remedy online, but nothing works. My app is only one activity, so it should be simple, but this is the first app I've developed. I'll attach my manifest xml file below.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.teamjava.theultimatetipcalculator"
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.teamjava.theultimatetipconverter.MainActivity"
android:screenOrientation="portrait" >
</activity>
<intent-filter>
<action android:name="android.intent.action.MainActivity" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</application>
You should probably try using the same package name for the app and location of your activity.
You have:
package="com.teamjava.theultimatetipcalculator"
android:name="com.teamjava.theultimatetipconverter.MainActivity"
Try
package="com.teamjava.theultimatetipcalculator"
android:name="com.teamjava.theultimatetipcalculator.MainActivity"
or
package="com.teamjava.theultimatetipconverter"
android:name="com.teamjava.theultimatetipconverter.MainActivity"
EDIT -
Also try placing the intent filter inside the activity. This is how my manifest looks on all my apps
<activity
android:name="com.example.exampleapp.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>
Change:
<action android:name="android.intent.action.MainActivity" />
to:
<action android:name="android.intent.action.MAIN" />
Have you checked your console in Eclipse? Sometimes, your program can compile fine, but display errors in the console on startup.
In Eclipse. Window - show view - Console

Android "application not installed" error on tablet, not on phone

I have scoured the internet for this, but none of the "answers" I have found so far have fixed it for me. My app installs and runs 100% on my phone, which runs Android 4.1.2. It appears to install ok on my tablet too, which runs Android 4.3. But when I try to run it on the tablet, I get the "Application is not installed" error. What is even stranger is that if I run it using the App Manager inside ES File Explorer, it runs fine!
So my suspicion is that Android 4.3 is more strict about something that 4.1.2 lets through. But what? I just can't find it. And why it should run from within ES File Explorer is just weird. The app manifest is below. I have tried several different values for the target SDK, but nothing makes any difference. The app is signed using the Export Wizard in Eclipse, using a certificate created there.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="marshallarts.wordfinder"
android:versionCode="10"
android:versionName="1.10" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:permission="android.permission.WRITE_EXTERNAL_STORAGE"
android:theme="#style/AppTheme"
android:hasCode="true" >
<activity
android:name=".StartActivity"
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=".EnterActivity"
android:label="#string/title_activity_enter"
android:theme="#android:style/Theme.Dialog">
</activity>
<activity
android:name=".PlayActivity"
android:label="#string/title_activity_play" >
</activity>
</application>
</manifest>
Would add as a comment but don't have enough rep at the moment.
Have you changed your default launcher activity in your project recently? It could be that the link in your Android Home application is referencing the old activity.
Well I have solved this at last. It was (of course) my error - I had not correctly understood how to specify the app's permissions, and had not set them properly in the manifest. Corrected that, and it now runs happily. It is still a minor mystery why it ran on my phone - seems to me it should not have - but no matter, I am now on the right track.

Android App Will Not Open

I have just created an Android app in Intellij. It works beautifully on the emulator, which is the same version of Android as I have on my phone (2.3.3) However, when i install the apk file on my phone, it installs fine, but then you can't open the app.
What I mean is that the install finishes and you have a done option but open is grayed out. There is no item in the menu, and there is no shortcut made. I have this in the manifest:
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
<application android:label="#string/app_name" android:icon="#drawable/icon" android:enabled="true">
<activity android:name="PhlogMain"
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=".PhlogEditNotes"/>
<service android:name=".PhlogListenerService"/>
</application>
I have the Samsung Galaxy Ace S5830 phone.
So after much work I rebuilt the whole thing, changed the keys and tried again and it worked. I am not really sure where it started to work but at least it is now! :-)

My apps will not install on device when downloaded from the Android Market

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.

Categories

Resources