AVD unable to lauch - android

When I run the project the .apk file get uploaded and installed successfully on the device but AVD unbale to launch. Please help me to solve this issue.
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bottleworks.dailymoney.core">
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

If it gives message "unable to upload file timeout" or something similar to that then close the emulator and run the app again
Otherwise post the logcat here to get better kind of solution

Make sure that the list of existing AVDs located in this folder
C:\Users\youruser\.android\avd
or test it this way :
1- right click in your app
2- run as => run configurations
3- Target Tab => manager
and post your error if you have any

you need to add application tag also in manifest.xml file.
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
>
<activity
android:name=".SplahScreenActivity"
android:label="#string/app_name"
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=".OtherActivity"
android:screenOrientation="portrait" >
</activity>
</application>

Related

Set default activity, execute before main Activity

I want to make register_activity is first run if application open. But, still MainActivity run first. Can anybody help me to fix this.
This is my Manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.client18.dd">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/Theme.AppCompat.DayNight.NoActionBar">
<activity android:name=".register_activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".signup_activity">
</activity>
<activity android:name=".MainActivity">
</activity>
</application>
</manifest>
When I see your Manifest file I can not see any faults. I suggest to do followings.
1) Uninstall app in emulator / device if its exists, and then run application.
or
2) Rebuild project with cleaning ( Build > Clean Project )
P.S.
If you could practice signup_activity > SignupActivity it is nice and best practice.

App Not Showing in Apps

I'm debugging using my Samsung Galaxy S5 and every time I run it through Android Studio it works fine and it pops up the app, but then when I click out of it it doesn't show in all of my apps like other apps I've installed to my device. The app will show in my task manager after I close out of it but it still won't show in all of my apps. Really could use some help on this one, thanks.
This is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="us.bisonsoftware.tab" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="Husky Athletics"
android:theme="#style/CustomActionBarTheme">
<activity
android:name=".TabBarExample"
android:label="Husky Athletics"
android:icon="#drawable/ic_launcher">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<data android:scheme="geo"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".FirstTab" />
<activity android:name=".SecondTab" />
<activity android:name=".ThirdTab" />
</application>
<uses-permission android:name="android.permission.INTERNET" ></uses-permission>
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
Try to make your activity name complete like this:
<activity
android:name="com.example.myapp.TabBarExample"
... >
</activity>
I dont know your package name. You have to fill it by yourself.

Failure [INSTALL_FAILED_INVALID_APK] on building and deploying android studio project

I'm developing an android application on Android Studio, it was working fine but recently it has been throwing the following error. Any ideas on how i can solve it?
EDIT: Usually after about ten tries it deploys
Waiting for device.
Target device: samsung-gt_p5100-c1607e2b52fa88f
Uploading file
local path: C:\Users\Yohannes\IdeaProjects\PaymentAssistant\out\production\PaymentAssistant\PaymentAssistant.apk
remote path: /data/local/tmp/tamru.yohannes.PaymentAssistant
Installing tamru.yohannes.PaymentAssistant
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/tamru.yohannes.PaymentAssistant"
pkg: /data/local/tmp/tamru.yohannes.PaymentAssistant
Failure [INSTALL_FAILED_INVALID_APK]
LogCat:
12-05 13:36:25.193 8332-8332/? E/cutils-traceļ¹• Error opening trace file: No such file or directory (2)
Manifest File
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="tamru.yohannes.PaymentAssistant"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:targetSdkVersion="15"
android:minSdkVersion="14"
tools:ignore="OldTargetApi" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
android:label="#string/app_name"
android:icon="#drawable/assistant"
android:allowBackup="false"
android:allowClearUserData="true"
android:debuggable="true"
android:hardwareAccelerated="true"
android:theme="#android:style/Theme.DeviceDefault.Light">
<activity
android:name="tamru.yohannes.PaymentAssistant.main.Main"
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="tamru.yohannes.PaymentAssistant.main.OCRCamera">
<intent-filter>
<action android:name="android.intent.action.OCRCamera"/>
</intent-filter>
</activity>
<activity
android:name="tamru.yohannes.PaymentAssistant.main.About"
android:label="#string/about" />
<activity
android:name="tamru.yohannes.PaymentAssistant.main.Preferences"
android:label="Preference" >
<intent-filter>
<action android:name="android.intent.action.Preferences"/>
<category android:name="android.intent.category.PREFERENCE"/>
</intent-filter>
</activity>
<activity
android:name="tamru.yohannes.PaymentAssistant.main.Transfer"
android:theme="#android:style/Theme.Holo.Dialog.NoActionBar" />
<activity
android:name="tamru.yohannes.PaymentAssistant.main.UserActions"
android:theme="#android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar" />
</application>
</manifest>
In my case (i have a rooted device) and when i rooted, something happened with my permission of /data/local/tmp and they have been changed, so adb can't get access temp file. How i solved:
1. Install RootExplorer
2. Create new "tmp" folder on sdcard
3. Long press on tmp folder, and select Link to this folder (last option in menu)
3. Go to /data/local/ and tap button CREATE LINK from bottom
Please change your package name to be all lower case in your manifest and make sure your android:name attributes for your activities reflect the changes.
Go to "Build" > "Clean Project". Works for me.

Can't install APK correctly on device

I have built & sign my apk by Eclipse ADT as it is describes (export and sign by creating a new key). But it can't be install on real device while an errors occurs, such as "installer package error". I have no Android device & sent my apk to friends by email. I'm using AVD and everyth is fine with it. Any suggestions? Thanx guys.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.XXXX.YYYY"
android:versionCode="0"
android:versionName="0.9.2" android:installLocation="internalOnly">
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:hardwareAccelerated="true"
android:permission="android.permission.INTERNET"
android:allowBackup="true">
<activity
android:name="com.XXXX.YYYY.ActivityMain"
android:label="#string/main_activity_title"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.XXXX.YYYY.ActivityDetails"
android:parentActivityName="com.XXXX.YYYY.ActivityMain"
android:excludeFromRecents="true"
android:configChanges="orientation|screenSize">
</activity>
</application></manifest>
UPD: apk installs good, but the error occurs if choose Open (see screenshot). After that app works fine. But on tablet if try open app it says "App deleted".
UPD2: add supporting API 4+ meta tag for the 2nd activity, but it takes no effect
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.XXXX.YYYY.ActivityMain" />
You probably need to make sure your device and your friend's devices can install apps that are not from the play store.
This is a feature you have to specifically set, or else apps that are outside the play store will not install.
Here is how to set it:
Open settings
Find the Security settings (Pre 4.0 it is under Applications)
Look for a setting that says Unknown sources, or non-market apps
Enable that setting
Everything should work after that!
Here is an article with pictures if you are still confused :)
Your example was missing the closing </manifest> and android:enabled. I'm not sure if the latter would prevent a device from fully installing it but the first one would.
I've also had issues using the full activity names in the past, so you may want to try using simplifying them to see if it helps.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.XXXX.YYYY"
android:versionCode="0"
android:versionName="0.9.2" android:installLocation="internalOnly">
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:hardwareAccelerated="true"
android:allowBackup="true">
<activity
android:name=".ActivityMain"
android:label="#string/main_activity_title"
android:enabled="true"
android:permission="android.permission.INTERNET"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ActivityDetails"
android:parentActivityName=".ActivityMain"
android:excludeFromRecents="true"
android:configChanges="orientation|screenSize">
</activity>
</application>
</manifest>
Is "Unknown sources" option under "security" allowed on device?
My problem was a duplicate internet permission request on Manifest! When I remove that from activity app was run normally.

APK Deployment Issue

I have been able to create a *.apk file from my code, place the file
in IIS, and download it onto a number of Android phones. Upon the
install, the application works exactly as expected.
However, after a phone is rebooted, the application name is changed to
the fully-qualified Java class name of the activity in the menu (so
"MyActivity" becomes "com.mycompany.MyActivity"), and when I try to go
to Menu > Settings, I get an error that causes android to force close
my application.
Looking into DDMS, I see that I get an error indicating that it can
not find my Preferences activity, despite the fact upon initial
install, it works properly.
I'm using Eclipse on Windows XP, and have several Android devices at
my disposal to test with.
Any idea what's going on?
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.app"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/logo" android:label="#string/app_name"> <!--android:debuggable="true">-->
<activity android:name="com.company.app.ActivityMain"
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.company.app.Preferences"
android:label="#string/app_settings">
<intent-filter>
<category android:name="android.intent.category.PREFERENCE"></category>
<action android:name="android.intent.action.MAIN"></action>
</intent-filter>
</activity>
<service android:name="com.company.app.Service"></service>
</application>
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
</manifest>
So I finally got this to work. I think that the package installer on the HTC Hero (and maybe the HTC Droid Eris) has some issues.
I uninstalled my application from the phone, changed the name of my main activity, and re-deployed it onto the Hero. I started to immediately get a "Force Close." I connected the device to DDMS and looked at the error. It was still looking for my old activity name. I factory reset the device and reinstalled the same package (with the updated name) and everything works as expected.
So it seems that the package installer is caching some part of the old manifest or something, not really sure what exactly is going on there. I may play with it some more if I get time.
I don't know if someone else could verify this problem, maybe it's something that should be taken up with HTC?
try to use this manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.app"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/logo" android:label="#string/app_name"> <!--android:debuggable="true">-->
<activity android:name=".ActivityMain"
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=".Preferences"
android:label="#string/app_settings">
<intent-filter>
<category android:name="android.intent.category.PREFERENCE"></category>
<action android:name="android.intent.action.MAIN"></action>
</intent-filter>
</activity>
<service android:name=".Service"></service>
</application>
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
</manifest>

Categories

Resources