2

manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.pvijayalakshmi.previousversion">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

grade file

apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "27.0.1"
defaultConfig {
    applicationId "com.example.pvijayalakshmi.previousversion"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 2
    versionName "1.1"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
testCompile 'junit:junit:4.12'
}

I have developed an application. And I have installed it on my phone.

Now I have a requirement of adding one column to the my application. I have added one column to the database. I have made changes to the onUpgrade(). I have changed the database version from 1 to 2.

I have changed the version code and version name in gradle file.

I don't want to uninstall the app and re installing. I want to upgrade the app automatically.

Now I am trying to install my application(after adding column to database) in phone where previous application is also existed.

I need to upgrade my previously existed application. But I am facing issue here. The present app does not overwrite the previous application. Both applications packages names are same here.

How can I overcome this. I need the programmatic solution.

For example we have many apps like whatsapp. They have made changes to the app and releases. So, we directly update to the new version with out uninstalling our existing whatsapp. Like wise I am trying to do.

Any help would be appreciated.

When I am trying to install application, It is showing like this.

image

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
bhavana
  • 63
  • 1
  • 8

5 Answers5

0

Go to your Developer Options in under mobile setting option

then, Enable these all are

  1. USB Debugging

  2. Install Via USB

  3. Verify apps over USB

these all are should be enable mode(checked mode)

then you have to try..

Raja
  • 2,775
  • 2
  • 19
  • 31
0
  1. you can check sure to uninstall once.
  2. you can clear cache on your phone.after that switch off the phone you can try again install.
  3. if the above not worked can you try creating signed APK file and install that once.
  4. clear the project once again...
JimHawkins
  • 4,843
  • 8
  • 35
  • 55
raviteja
  • 67
  • 1
  • 13
0

If your existing i.e installed app in phone is signed APK then to overwrite the new APK on it means without uninstall old one run new APK , you have to install signed APK of new one in sdcard and after that install that. It will work.

Dharmishtha
  • 1,313
  • 10
  • 21
0

Android App Not Install. An existing package by the same name with a conflicting signature is already installed

This answer works for me thank you so much for stackoverflow.

bhavana
  • 63
  • 1
  • 8
0

You might want to disable instant run Android Studio Settings or Preferences-> Build,Execution,Deployment -> Instant Run.

enter image description here

clean and rebuild the project again

if you are using miui phone then Turn Off MIUI optimization

Settings --> Additional settings --> Developer options --> Turn Off MIUI optimization

Manohar
  • 22,116
  • 9
  • 108
  • 144