Where can I find the apk file on my Android phone? - android

I am trying to develop android applications with eclipse (following this tutorial ). Clicking the 'Run' button inside eclipse (running on Linux) and choosing an android device, eclipse tells me that the application is successfully installed on the device.
[2014-07-02 19:26:55 - MyFirstApp] Installing MyFirstApp.apk...
[2014-07-02 19:27:01 - MyFirstApp] Success!
[2014-07-02 19:27:02 - MyFirstApp] /MyFirstApp/bin/MyFirstApp.apk installed on device
[2014-07-02 19:27:02 - MyFirstApp] Done!
However, I cannot find this application in the list of installed applications on the phone. It only shows up in Settings -> Applications where I am only able to remove it, but not to start it. Maybe I need to do something special in order to let the app show up normally and useable?
As a next step, I installed an 'AppInstaller' to install the apk file. But I do now know which folder on the android phone the apk has been copied to. Where did eclipse put the apk in?
This is in the manifest:
<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>

The most likely cause is that you didn't specify a launcher activity in the Manifest.
<activity android:name="... >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
From the documentation:
The ACTION_MAIN action indicates this is the main entry point and does not expect any intent data.
The CATEGORY_LAUNCHER category indicates that this activity's icon should be placed in the system's app launcher. If the
element does not specify an icon with icon, then the system uses the
icon from the element.

Related

Unable to launch app on device

I am trying to run a demo project to implement widgets, it compiles successfully but did not launch, also I did not find it installed in my phone.
I am following this tutorial http://www.tutorialspoint.com/android/android_widgets.htm
A also this tutorial https://github.com/TechIsFun/android-widget-example but getting the same problem.
My console shows
[2014-11-23 11:01:30 - WidgetExample] Performing sync
[2014-11-23 11:01:30 - WidgetExample] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2014-11-23 11:01:34 - WidgetExample] Uploading WidgetExample.apk onto device '1C9E_9E18_MicromaxA111'
[2014-11-23 11:01:34 - WidgetExample] Installing WidgetExample.apk...
[2014-11-23 11:01:37 - WidgetExample] Success!
[2014-11-23 11:01:37 - WidgetExample] \WidgetExample\bin\WidgetExample.apk installed on device
[2014-11-23 11:01:37 - WidgetExample] Done!
I think there is some problem with the manifest file ?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.widgetexample"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<receiver
android:name="MyWidgetProvider"
android:icon="#drawable/ic_launcher"
android:label="Example Widget" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/widget_info" />
</receiver>
</application>
</manifest>
Your console message shows that your apk is isntalled sccuessfully on the device. Now the question is why it is not getting launched?
To launch any application, it should have at least one activity with action as main and category as launcher.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
In your case, your application don't have any activity assoicated with it.
I think this is the casue why its not getting launched afer sccuessful installation. also thats why its not showing your application on application list.
As your application have only one widget hence it will show it under widgets list. Please check.
Hope it helps you.

Android app not showing on my device. No Launcher Activity Found

I am simply following the Android Developer training guide, and I am already running into troubles on the second step.
I followed the guide (I don't even have to do anything..) and clicked on Run, selected my Galaxy S4 from the screen, and clicked okay. I get the following error
[2014-07-06 19:56:27 - MyFirstApp] Android Launch!
[2014-07-06 19:56:27 - MyFirstApp] adb is running normally.
[2014-07-06 19:56:27 - MyFirstApp] No Launcher activity found!
[2014-07-06 19:56:27 - MyFirstApp] The launch will only sync the application package on the device!
[2014-07-06 19:56:27 - MyFirstApp] Performing sync
[2014-07-06 19:56:27 - MyFirstApp] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2014-07-06 19:56:31 - MyFirstApp] Application already deployed. No need to reinstall.
[2014-07-06 19:56:31 - MyFirstApp] \MyFirstApp\bin\MyFirstApp.apk installed on device
[2014-07-06 19:56:31 - MyFirstApp] Done!
I honestly have no idea what I am doing wrong, as I have absolutely no experiences with android.
The only thing that is different is in the tutorial their targetSdkVersion is 19, but I am using 21
The following is my AndroidManefiest.xml
<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 forgot to declare your activity to your Manifest.xml.
Everytime you create an activity (blablabla class extends Activity) you have to declare it to your Android Manifest.xml, in order to de device be able to track your App's life cicle.
What we call Activity is a class that provide information to host a window, the class should extends Activity, all of this classes must be declared on the Manifest.xml file as below:
<application>
...
<activity
android:name="com.yourpackage.ClassName">
</activity>
</application>
Probably your activity class is called MainActivity, you just have to add this to your code, between <application> </application> tag:
<activity
android:name="com.example.myfirstapp.MainActivity"
android:label="#string/app_name"> <!-- This is the text that will appear on your action bar -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
The <intent-filter> tells to android that this class is the "main entrance", the first activity that need to be loaded to your app be launched, only the first activity need the <intent-filter> tag, the others just need the fist example I gave.
If you are starting with Android development, I recommend you to read about ActionBar and What to do when the device is rotated
This and this may help you in the future.
Good coding :)
Put the following intent-filter for your activity to be launched.
<activity class=".YourActivity" android:label="your activity label">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
{ action=android.app.action.MAIN } matches all of the activities that
can be used as top-level entry points into an application.
{ action=android.app.action.MAIN,
category=android.app.category.LAUNCHER } is the actual intent used by
the Launcher to populate its top-level list.
Also, please refer to Intent

Using Hardware Device but cannot find installed app

I followed the procedure on Using Hardware Device from google android's page, after having problems with emulator. After having followed everything provided on google's hardware page, i created a new project and ran it, it gave me the following,
[2014-03-17 18:35:18 - FirstAppProject] ------------------------------
[2014-03-17 18:35:18 - FirstAppProject] Android Launch!
[2014-03-17 18:35:18 - FirstAppProject] adb is running normally.
[2014-03-17 18:35:18 - FirstAppProject] No Launcher activity found!
[2014-03-17 18:35:18 - FirstAppProject] The launch will only sync the application package on the device!
[2014-03-17 18:35:18 - FirstAppProject] Performing sync
[2014-03-17 18:35:18 - FirstAppProject] Automatic Target Mode: using device '0123456789ABCDEF'
[2014-03-17 18:35:18 - FirstAppProject] Uploading FirstAppProject.apk onto device '0123456789ABCDEF'
[2014-03-17 18:35:19 - FirstAppProject] Installing FirstAppProject.apk...
[2014-03-17 18:35:25 - FirstAppProject] Success!
[2014-03-17 18:35:25 - FirstAppProject] \FirstAppProject\bin\FirstAppProject.apk installed on device
[2014-03-17 18:35:25 - FirstAppProject] Done!
Which seem to me that the app is installed on my device, but i cant seem to find the app on my device so that i can test it.
What to do ?
If that is your manifest:
<manifest xmlns:android="schemas.android.com/apk/res/android";
package="com.faizanchaki.firstappproject" 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" >
<!-- no activities declared here -->
</application>
</manifest>
Then you are missing the declaration of a main activity like:
<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>
you should declare the main activity in your Manifest so that your app icon will appear in the android launcher and you will be able to actually start your app. Just put your Activity name and add it to the main manifest where I put the comment.

Installed test APK does not appear on device's main screen

I installed an instrumentation test APK from Eclipse(Run->Run As Android application) on device as the log shows below.
[2013-08-08 22:14:13 - SettingsTests] /SettingsTests/bin/SettingsTests.apk installed on device
However, on the home screen of the device, somehow the test APK does not show. In Settings->Application Manager, the list shows the test apk correctly.
Any idea what's going on?
The android system info shows:
Source:/data/app/PACKAGE.test.test-1.apk
data:/data/app/PACKAGE.test.test
Here's the test apk's manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="PACKAGE.test.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="17" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="my.package" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<uses-library android:name="android.test.runner" />
</application>
</manifest>
Only the activity defined in manifest like below will be shown. You must define at least one activty like that.
<activity
android:name="YourActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
What you are trying to install doesn't have an activity defined in the manifest.
As per the docs
An activity is that implements part of the application's visual user interface.
All activities must be represented by <activity> elements in the manifest file.
Any that are not declared there will not be seen by the system and will never be run.
You can refer the document so as to have an idea how activity works
It's quite normal behavior, as you don't have any activity in your instrumentation package. Didn't you mean to run it as Android JUnit Test?

New package not yet registered with the system. Error on a real phone

I am working on an Android project in Eclipse and debugging / testing using my HTC Desire Z. I was coding away building a menu for my app when I started getting this error which is preventing me from continuing. Lots of people have had this error but none of the solutions that I found have worked for me. I tried cleaning and rebuilding the project, manually uninstalling the app from my phone, and renaming the domain in the manifest file. For people using an emulator they talked about deleting the data file but I'm not sure what this translates to when using a real phone.
Here is the console when I try to build:
[2011-08-09 06:57:13 - GreenThumbs] Android Launch!
[2011-08-09 06:57:13 - GreenThumbs] adb is running normally.
[2011-08-09 06:57:13 - GreenThumbs] Performing com.hernblog.GreenThumbs.GreenThumbs activity launch
[2011-08-09 06:57:13 - GreenThumbs] Automatic Target Mode: using device 'HT0ANRV03417'
[2011-08-09 06:57:13 - GreenThumbs] Uploading GreenThumbs.apk onto device 'HT0ANRV03417'
[2011-08-09 06:57:13 - GreenThumbs] Installing GreenThumbs.apk...
[2011-08-09 06:57:16 - GreenThumbs] Success!
[2011-08-09 06:57:17 - GreenThumbs] Starting activity com.hernblog.GreenThumbs.GreenThumbs on device HT0ANRV03417
[2011-08-09 06:57:19 - GreenThumbs] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2011-08-09 06:57:22 - GreenThumbs] Starting activity com.hernblog.GreenThumbs.GreenThumbs on device HT0ANRV03417
[2011-08-09 06:57:23 - GreenThumbs] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2011-08-09 06:57:23 - GreenThumbs] ActivityManager: Error: Activity class {com.hernblog.GreenThumbs/com.hernblog.GreenThumbs.GreenThumbs} does not exist.
[2011-08-09 06:57:26 - GreenThumbs] Starting activity com.hernblog.GreenThumbs.GreenThumbs on device HT0ANRV03417
[2011-08-09 06:57:27 - GreenThumbs] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2011-08-09 06:57:30 - GreenThumbs] Starting activity com.hernblog.GreenThumbs.GreenThumbs on device HT0ANRV03417
[2011-08-09 06:57:30 - GreenThumbs] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2011-08-09 06:57:33 - GreenThumbs] Starting activity com.hernblog.GreenThumbs.GreenThumbs on device HT0ANRV03417
[2011-08-09 06:57:34 - GreenThumbs] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.hernblog.GreenThumbs/.GreenThumbs }
[2011-08-09 06:57:34 - GreenThumbs] ActivityManager: Error type 3
[2011-08-09 06:57:34 - GreenThumbs] ActivityManager: Error: Activity class {com.hernblog.GreenThumbs/com.hernblog.GreenThumbs.GreenThumbs} does not exist.
And here is my manifest file:
?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hernblog.GreenThumbs"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application>
<uses-library android:name="android.test.runner" />
</application>
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.hernblog.Green.Thumbs" android:label="GreenThumbs Tests" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="GreenThumbs"
android:label="#string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Any ideas on how to fix this?
I too had this problem immediately after changing the package name of my app (prepping it for Android Market). In Eclipse do a Project > Clean... , then turn off Build-Automatically so you can Build-All.
I got this error after renaming my project package. I fixed it by doing a clean in Eclipse. Then a full rebuild. After that pressing F11 launched the application on the device. (I also uninstalled the application from the device before that but I don't think that was the problem).
I solved this by unchecking the "Is Library" in Project->Properties->Android
Really a confusing Error...and what worked for me is :
Rename the app package name in Manifest xml file to some other name, any!
Save project, try to run it, mine gave lots of errors and didn't run!
Again roll back to old name...save and run!
Cleaning the project didn't work for me. I was able to fix this issue by doing the following:
Add #!/system/bin/sh as the first line /system/bin/am
Add #!/system/bin/sh as the first line /system/bin/pm
I was getting this issue when using some custom ROMs on my phone.
Hope this fixes your problem,
Joey
This is eclipse problem 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 :)
I too got the same error.
And able to resolve with following steps.
In phone that you are testing,
1.go to settings>Apps>Downloaded
2.Go to bottom, I found my app has been disabled.
3.Now uninstall it.
4.In the next run able to install it properly.
Thanks.
Check your package names. At one point you're using com.hernblog.GreenThumbs (unusual to have upper-case package names) then com.hernblog.Green.Thumbs and you even have an activity named com.hernblog.GreenThumbs.GreenThumbs!
I managed to fix this through some voo-doo magic combination of steps. I did many of the things mentioned as answers above, but I think the big fix happened when I updated to a new version of Android.
Thanks for the help guys. I appologize for not having a clear answer on how to fix this problem.
Ok, here's my answer. I was pulling my hair out trying to find the answer to this. I found at his link that the person basically had to create a new project and copy all of the old files into that. So, that's what I did, and it worked! I couldn't believe it. It took me a long time to find it.
However, while working on my new project, I made a change and the same error occurred again. Luckily, I know what change I made, and I undid it and the error cleared.
I added another application tag to the android manifest and it then generated the error. I simply undid it and the error went away.
I opened my app in Google Play, and press "enable"...
Wow! I founded in manifest: android:enabled="false" ... and deleted it!)
I had to reset my device/phone.
Background on how I confused my device:
I pushed the APP.apk to /system/app (this was the wrong place I guess)
I also used eclipse to deploy directly via adb
I then deinstalled manually these apps via settings
then I ran into the cited error "New package not yet registered with the system."
My answer: try test on your friend's device.
I also have the same problem. My Phone is LG lu-3000.
This symptom occurred after I moved my project from Mac to Windows.
After stuck on 10 days I found it runs on Android Virtual Device(but too slow to test anything) and now spent some days more and found out it DOES RUN on the other device!!
Before I tested on AVB and Motorola Bionic, I factory-reset my phone and did everything above. But it didn't change any result. It runs on neither Mac nor Windows.
More disastrous thing is now none of my android project is run on my device..
It is almost 2 years gone from I purchased this device.
If you have deleted the application by hand from the connected device and you still get the same error, please restart the connected device, and it will work correctly!
Check "android:installLocation" in your AndroidManifest.xml.
"preferExternal" will cause the problem.
I too had this problem immediately after changing the package name of my app. In Eclipse go to Project--> Clean, then turn off Build-Automatically so you can Build-All and don't forget to restart the eclipse. Then its working fine for me..
I solved this problem by setting the minimum SDK level of the project lower than the phone's SDK level.
Also try to free memory from the device, uninstall some apps to do this. solved the issue for me.
Make sure you have
<uses-sdk
android:minSdkVersion="yourMinSDKver"
android:targetSdkVersion="youtTargetSDKver" />
on top, in your manifest.xml file. I did swap it by mistake and got this very same error.
I made a really silly mistake. I laughed at when i caught it. There were two application tags in one application!!! have a look
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.riddhi.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".WCFActivity"
android:label="#string/title_activity_main" >
</activity>
</application>
which should be
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.riddhi.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".WCFActivity"
android:label="#string/title_activity_main" >
</activity>
</application>
so i fixed my project. I hope this will be useful to you.
Check your Manifest file. If it has multiple Tags it will face this as it will look for Class in the first Application tag it finds.

Categories

Resources