Android update is installing app again - android

I have searched through the forum, but found no match for the issue I am currently facing:
I have an app, which installs and works ok, but when I try to update it (install again), the application does not update, but is installed separately one more time - I get two shortcuts, different app data, both versions work, etc.
I have not changed the application name, have observed the same behavior in adb and with actual phone and tablet, also tried with same and increased app version...
This is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rts.android.language" android:versionCode="1" android:versionName="1.1"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="com.rts.android.language.ui.MainActivity"
android:label="#string/app_name"android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Any ideas what the reason might be?
Thanks!

please, make sure both applications contain same package name?
package="com.rts.android.language"

First, try to rename your activity:
from:
<activity android:name="com.rts.android.language.ui.MainActivity" />
to :
<activity android:name=".ui.MainActivity" />
Try to clean your project then build/rebuild...
When doing that you need to clean your Keystore:
%USERPROFILE%/.androidon Windows
~/.android/debug.keystore on Linux and Mac OS X

Related

APK not running on real device - Manifest error?

I am new on app's code. My project runs perfectly on emulators. However the apk is not running in my samsung device. Checking it with the Android Studio Analyzer the line xmlns:android="http://schemas.android.com/apk/res/android" in the manifest.xml returns in red. It seems that something is wrong with my project Manifest. Any Help? My manifest is copied below.
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0"
package="com.ferleecidade.a100dia11">
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26" />
<application
android:theme="#ref/0x7f0f0005"
android:label="#ref/0x7f0e001f"
android:icon="#ref/0x7f0c0000"
android:debuggable="true"
android:exported="true"
android:allowBackup="true"
android:supportsRtl="true"
android:roundIcon="#ref/0x7f0c0002">
<activity
android:name="com.ferleecidade.a100dia11.MainActivity">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ferleecidade.a100dia11.MyCustomList" />
<meta-data
android:name="preloaded_fonts"
android:resource="#ref/0x7f020003" />
<meta-data
android:name="android.support.VERSION"
android:value="26.1.0" />
<meta-data
android:name="android.arch.lifecycle.VERSION"
android:value="27.0.0-SNAPSHOT" />
</application>
</manifest>
Help? Yes.
I am actively looking into this right now.
I don't believe your manifest is causing this or at least isn't the sole cause.
I have a project that I can run on my devices and emulators and deploy without a glitch.
I also get an error on the same line you do when analyzing the APK (Build/.Analyze APK).
If you hover your cursor over the red text you will see your error popup.
Mine says "URI is not registered (Settings | Languages and Frameworks | Schemes and DTDs)"
I performed a quick experiment.
created a brand new project in Android Studio with a single activity.
Cleaned the project.
Ran in an emulator.
Generated a signed APK.
Analyzed the APK and the error is there.
I suggest you try this.
This leads me to believe one of two things.
There is something wrong with my default project settings.
The error is being incorrectly reported by Android studio.
I hope this was useful.

Not able to install my application on other Android devices

I have made an Android app using AndroidStudio and want to test it on different phones. I have generated the signed apk (release version) and I could successfully install the apk on my device (Nexus 5).
Then I tried to install the same apk on a Nexus 4 but it throws an error after the installation that the package installer has stopped.
Here is what my manifest file looks like
<?xml version="1.0" encoding="utf-8"?>
<application
android:permission="android.permission.WRITE_EXTERNAL_STORAGE"
android:allowBackup="true"
android:icon="#drawable/endecrypt_ico"
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>
<activity
android:name=".PostSubmission"
android:label="#string/title_activity_post_submission"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.psimit.encrypt.MainActivity" />
</activity>
</application>
I am not able to understand where the problem lies. Since the app works when installed via the debugger and also using the apk on my phone, I am tempted to think if I need to do something more for compatibility across Nexus 4 and Nexus 5 during the generation of the signed apk.
I would quite appreciate some pointers if someone has encountered this problem earlier. Thanks in advance.
It's a really strange issue you have. Maybe you're doing things wrong.
The permissions should be at the root of the manifest tag :
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.app">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application>
<activity
...
</activity>
</application>
</manifest>

android application resetting to older version

I have made an app which is pre-installed on android device of particular manufacturer. After this I have release an upgrade of application for example initial version 1.0.0.0 to upgrade version of 1.2.0.0. After upgrading the app if user restarts its phone then my application goes to the initial version of 1.0.0.0.
Don't know why this is happening ? Is there a problem in bundling the application to devices ?
Note: I am updating my app via my server and not from play store and this issue is reproducible only when app is pre-installed on devices.
In mainfest file of both the versions I forgot to change android:versionCode value, in both the versions android:versionCode=3. Is it creating problem because of this?
I have also changed the package name of Application class so is this is creating the problem ?
Manifest for first version:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.apps.spinr"
android:versionCode="1"
android:versionName="1.0.0.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="11" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#style/SpinrTheme"
android:name="com.abc.xyz.GDApplication">
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Mainfest for second version:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.apps.spinr"
android:versionCode="1"
android:versionName="1.2.0.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="11" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#style/SpinrTheme"
android:name="com.xxx.apps.GDApplication">
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks for the suggestion. As #Mahmoud in comment suggested that "google play never release update for the app with the same version code", so I incremented version code of app and it worked fine. #Rat-a-tat-a-tat Ratatouille as I said in question I am not updating my app via google play neither my app is on play store so I was not able to figure this out initially. Anyways thanks for help.
So conclusion is
whenever you want to send upgrade of app always increase version code
of the app

Why usbManager.getAcccessoryList(); always returns null?

I am testing my app in Samsung Galaxy S2 with Android 2.3.4
I am following
http://developer.android.com/guide/topics/usb/accessory.html
instructions.
When ever I try to run it, usbManager.getAcccessoryList(); giving null.
Even I tried by connecting OTG cabel and pendrive to it.
My manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature android:name="android.hardware.usb.accessory" />
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="#drawable/icon"
android:label="#string/app_name" >
<uses-library android:name="com.android.future.usb.accessory" />
<activity
android:name=".SplashScreen"
android:clearTaskOnLaunch="true"
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=".Advanced"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".Edit"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".Add"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="Main"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="#xml/accessory_filter" />
</activity>
</application>
</manifest>
I had the same problem but my tablet has ICS. If try what I did, might work. I've been searching a lot for this, and couldn't find it, but thanks to all the people who have spent a few moments answering our questions, and the wiki resources on the web, I figured it out.
There are some missing files in some android builds, like the AINOL NOVO 7 PALADIN. I think this would work in any ICS tablet with the same issue. I understand that the Galaxy Tab has the same issue but as I don't have one I can't confirm this. If you do, let me know if it works for you.
So lets push the files in and see how it goes.
Copy some missing files into system drive:
$ adb remount
$ adb push AINOL_FIX/system/etc/permissions/android.hardware.usb.host.xml /system/etc/permissions
$ adb push AINOL_FIX/system/etc/permissions/android.hardware.usb.accessory.xml /system/etc/permissions
NOTE: If an error appears displaying Out of Memory, it's right and you must delete some files from system drive. I recommend some live wallpapers from system/app.
I understand that for writing system drive you should have root access, I already had it when I did this so if it doesn't work, root it.
You can get the files from android source builds or from a tablet where USB-HOST API is actually working. I got them from linaro's ICS build for pandaboard.
Now, you should try finding those files but for Gingerbread and you'll also need to push the
future.usb.accesory.jar into system/framework, if it isn't there already.
$ adb push AINOL_FIX/system/framework/com.android.future.usb.accessory.jar /system/framework
A cite from http://developer.android.com/guide/topics/usb/accessory.html: "Set the minimum SDK of the application to API Level 10 if you are using the add-on library or 12 if you are using the android.hardware.usb package."
You are using the android.hardware.usb package. So, you have to put the version to 12.
An error is found :-)
And don't forget to really change SDK version to 12, not only declare it!
Use com.android.future.usb package instead, according to docs.

Confusion why a magic 1.6 user cannot find app on market

I've published an app today mainly for my forum users to use, just a
very simple app that displays wallpapers derived from the forum.
Problem I'm having is one guy says it doesn't appear in the market,
and I've even sent him the APK to install manually but it fails.
My minimum SDK version is 4, I created it with the 1.6 SDK specified
so not sure why he can't see it or install it. He has a 1.6 Magic
handset.
So just wondering if anyone has any ideas, the app is called bocn
wallpaper, it uses internet and set-wallpaper permissions.. but I
wouldn't have thought the permissions were the problem...
My manifest is as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0" package="net.dbws.bocnwallpaper">
<application android:icon="#drawable/launcher_icon"
android:label="#string/app_name">
<activity android:name=".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>
<meta-data android:value="xxxxx" android:name="ADMOB_PUBLISHER_ID" />
</application>
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.SET_WALLPAPER" />
</manifest>
Please, check the supported screens: http://developer.android.com/guide/topics/manifest/supports-screens-element.html
Android 1.6 has small-screens flag set default to false. May be it causes that the application is not seen on the device of the guy.

Categories

Resources