I have edited the versionCode in both the android\app\build.gradle file :
versionCode 2
versionName "2.0"
and I have updated the AndroidManifest.xml file
package="com.reactnativeapp"
android:versionCode="2"
android:versionName="2.0"
BUT I still get this error when I try to release an update to my app on google play store!
You need to use a different version code for your APK or Android App Bundle
because you already have one with version code 1.
I have tried running
gradlew clean
in the android folder and rebuilding the project and nothing has worked. Does anyone have any ideas?
Make sure that you have your versionCode and versionName set inside defaultConfig like this:
android {
...
defaultConfig {
versionCode = 2
versionName = "2.0"
}
...
}
You might have it set up for a debug-only config, which wouldn't change for release builds.
I have one application of Trivia, the package name is es.test.triv.sh, there are all things for play one player, I have add a new feature is a multi-player options, for this option I have use the real-time of google play, and I have to register the application with the package, here is the problem the implantation of this feature for multiplayers is on new module of android and have a different package com.stas.triv.mlt
https://developers.google.com/games/services/console/enabling#c_specify_client_id_settings
On this point I have to set com.stas.triv.mlt or es.test.triv.sh?
That package name always refers to the package name that Google Play console uses for your Application Id.
It used to be the one in the manifest.xml of your application
<manifest package="tv.potato.baked"
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:label="#string/app_name"
>
.
.
But on (recent versions?) of Android Studio, this package is ignored, and the one defined in your application module's build.gradle is the one used:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "tv.potato.baked"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
.
.
.
That package name also defines your app name in the playstore (look at the url), so once the app has been published for the first time it cannot be changed.
I received this error while uploading my APK to GooglePlay:
"APKs supporting Android Wear must have a minimum SDK version of at least 23, this APK has 20."
Both my mobile app and wear app have their minimum SDKs set to 20.
I've never had any problems updating my app previously, this appears to be a new restriction.
Is it a valid error? I thought the minimum SDK for Wear is 20 [Android 4.4W / Kitkat]
I tried un-ticking: "Pricing & Distribution: Distribute your app on Android Wear [ ]", but the error still occurs.
The problem is that I have folks using SDKs 21 & 22 as well. Also, while it is a dedicated Wear app, it has some utility as a standalone mobile app as well.
Any advice?
Apparently these rejections are due to changes Google made in preparation for Android Wear 2.0 standalone apps. Sometimes this restriction is inadvertently blocking phone apps that contain Android Wear 1.0 apps due to a manifest entry.
If you have a uses-feature manifest entry in your host/phone app for android.hardware.type.watch, remove it and you should be able to upload and get past the validation. Complete manifest entry below:
<uses-feature
android:name="android.hardware.type.watch"
android:required="false />
I have same problem and I couldn't find different solution to upload Multiple APK. This solution is not best(there is no wear support 23-) but no way to upload APK.
First I seperate AndroidManifest.xml 23- between 23+ cause of
<uses-feature
android:name="android.hardware.type.watch"
android:required="false"/>
App gradle:
productFlavors {
demoVer {
versionName = android.defaultConfig.versionName + "-TEST"
}
prodVer {
signingConfig signingConfigs.config
minSdkVersion 17
maxSdkVersion 22
versionCode 74
}
prodVerMin23 {
signingConfig signingConfigs.config
minSdkVersion 23
versionCode 75
}
}
dependencies {wearApp project(path: ':wearapp', configuration: 'prodVerMin23Release')}
Wear gradle:
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
minSdkVersion 20
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
prodVerMin23 {
minSdkVersion 20
}
}
I ran into the same problem and found that you have to upload Multiple APKs to Google Play.
One APK which supports API level 23 and up (included wear 23 and up) and another one which supports API level 20 to 22 (included wear 20 to 22).
More info:
https://developer.android.com/google/play/publishing/multiple-apks.html
P.S.: Sorry for my English.
apk upload failed to the google play market.
I am trying to upload the upgraded version of my app to the google play but I am keep getting the message -
Upload failed
You need to use a different version code for your APK because you already have one with version code 1.
Your APK needs to have the package name com.corntail.project.
There is still something that is looking for com.corntail.project and it is not being found.
UPDATE:
In my AndroidManifest.xml, the relevant code is -
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.corntail.main"
android:versionCode="1"
android:versionName="1.0" >
If you're using Android Studio or building with gradle, edit your gradle script (build.gradle) to change your package name and version. These values overwrite your AndroidManifest.xml file.
For example:
defaultConfig {
applicationId "com.xyz.abc"
minSdkVersion 16
targetSdkVersion 19
versionCode 2
versionName "1.1"
}
You need to change your android:versionCode="1" to 2 on the AndroidManifest...
Things you have to keep in mind when updating your application on Google Play :
Change Version code +1 depending on the old value - if it's 1 , you have to change it to a bigger number.
Change your App Version Name to something bigger / different if it's string - if your old version is 1.0 - it should be 1.1 / 1.0.1 or whatever you like (it's always a better option t have some version name strategy, if it will contains the date update addded or the revision it depends on you).
And if you want to be able to update your app, don't change project package name! That's how android system knows that this application is different than that one. If you change your package name, it's now acting like a new app and you won't be able to update it from Google Play Store! To change your package name to com.corntail.project first you need to change it in manifest and after that in your project's main package and you need to keep track of your activities, if you declared them with package name too. For example :
if your MainActiivty was declared in manifest like :
com.corntail.main.MainActivity
you need to change it now to be like :
com.corntail.project.MainActivity.
You need to use a different version code for your APK because you
already have one with version code 1.
You must change your version code in your androidmanifest.xml
Every time you update your app change this variable in you XML file:
android:versionCode="1"
You are getting 2 errors.
The Version Code: you always need to set a higher number in the versionCode and always use an integer number. (don't use 1.1)
android:versionCode="1"
The package name: it has to match the same string that you used in the latest version that you upload. So instead of package="com.corntail.main" you should use:
package="com.corntail.project"
After modify the AndroidManifest.xml save it and then search in the folder src the package called "com.corntail.main", right click, Refactor > Rename, and the new name should match what you put in package (in this example you should call it: 'com.corntail.project') and you are done!
Good luck!
You have change version code in increasing order i.e. 1,2,3...so on as every time you uploaded. In every upload version code should have greater number than previous upload version code. You can change version code in APP Module Build.gradle file.
Image
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.xyz"
minSdkVersion 14
targetSdkVersion 24
versionCode 5
versionName "1.1.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
If you build with gradlew, you should check the build.gradle file,
the applicationId will overwrite the package value in the AndroidManifest.xml
android {
defaultConfig {
applicationId "xxx.xxx.xxx"
}
}
I am new to Android development and I want first to get the Hello World application running.
I am using Eclipse IDE and the Android 4.0.3 version 15 SDK. I copied everything from a tutorial site, but when I try to run the application on the virtual device I get this error:
[2012-02-01 11:31:23 - Android_test] Installation error: INSTALL_FAILED_OLDER_SDK
[2012-02-01 11:31:23 - Android_test] Please check logcat output for more details.
[2012-02-01 11:31:23 - Android_test] Launch canceled!
Here is my class in the com.maze.app package:
package com.maze.app;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity{
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
and the AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.maze.app"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="#string/app_name"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity android:name="HelloAndroid" android:launchMode="standard" android:enabled="true"></activity>
</application>
Here is the configuration of the Virtual Device:
Name: AndroidVD
CPU/ABI: ARM(armeabi-v7a)
Path: path\to\avd
Target: Android 4.0.3(API level 15)
Skin: WVGA800
hw.lcd.density: 240
hw.cpu.model: cortex-a8
vm.heapSize: 48
hw.ramSize:512
What is the problem?
EDIT:
The application is not running on the Virtual Device:
Here is what I get on LogCat(some of the lines):
D/PackageManager(92): New package installed in /data/app/com.maze.app-2.apk
D/dalvikvm(92): GC_CONCURRENT freed 660K, 9% free 11935K/12999K, paused 18ms+72ms
I/ActivityManager(92): Force stopping package com.maze.app uid=10040
D/BackupManagerService(92): Received broadcast Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:com.maze.app flg=0x10000010 (has extras) }
V/BackupManagerService(92): updatePackageParticipantsLocked: com.maze.app
It is due to android:targetSdkVersion="#string/app_name" in your manifiest file.
Change it to:
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="15"/>
The targetSdkVersion should be an integer, but #string/app_name would be a string. I think this causing the error.
EDIT:
You have to add a default intent-filter in your manifiest file for the activity. Then only android can launch the activity. otherwise you will get the below error in your console window.
[2012-02-02 09:17:39 - Test] No Launcher activity found!
[2012-02-02 09:17:39 - Test] The launch will only sync the application package on the device!
Add the following to your <activity> tag.
<activity android:name="HelloAndroid" android:launchMode="standard" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This means the version of android of your avd is older than the version being used to compile the code
This error occurs when the sdk-version installed on your device (real or virtual device) is smaller than android:minSdkVersion in your android manifest.
You either have to decrease your android:minSdkVersion or you have to specify a higher api-version for your AVD.
Keep in mind, that it is not always trivial to decrease android:minSdkVersion as you have to make sure, your app cares about the actual installed API and uses the correct methods:
AsyncTask<String, Object, String> task = new AsyncTask<String, Object, String>() {
#Override
protected Boolean doInBackground(String... params) {
if (params == null) return "";
StringBuilder b = new StringBuilder();
for (String p : params) {
b.append(p);
}
return b.toString();
}
};
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,"Hello", " ", "world!");
} else {
task.execute("Hello", " ", "world!");
}
Using the android-support-library and/or libraries like actionbar-sherlock will help you dealing especially with widgets of older versions.
I am using Android Studio 0.8.1. I have a project's gradle file like below:
android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.omersonmez.widgets.hotspot"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
My emulator was android 4.0.
So i modified my emulator and made api level 4.0.3(apilevel 15).
It worked.
I tried all the responses described here but my solution was changing inside my build.gradle file minSdkVersion from 8 to 9 because some libraries in my project can´t work with API 8, that´s was the reason for the message INSTALL_FAILED_OLDER_SDK:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.tuna.hello.androidstudioapplication"
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
...
...
...
In my case I edited a project having this in the AndroidManifest.xml file, and which was ginving me the above error, at runtime:
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
What I did just, was to change minSdkVersion="17", to minSdkVersion="16". My resulting tag was:
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="17" />
Now I'm not getting the error anymore..
Hope this helps
Received the same error , the problem was difference in the version of Android SDK which AVD was using and the version in AndroidManifest file. I could solve it by correcting the
android:minSdkVersion="16"
to match with AVD.
You will see the same error if you are trying to install an apk that was built using
compileSdkVersion "android-L"
Even for devices running the final version of Android 5.0.
Simply change this to
compileSdkVersion 21
Fix for new Android 6.0 Marshmallow
Fixed my issue when I updated to API 23 (Android 6.0 Marshmallow) by updating the build tools version to 23.0.0 as follows:
android {
buildToolsVersion '23.0.0'
...
And went to File > Project Structure , chose Properties tab then updated the Compile Sdk version to "API 23: Android 5.X (MNC)" and the Build tools version to "23.0.0"
I am on Android Studio. I got this error when min/targetSDKVersion were set to 17. While looking thro this thread, I tried to change the minSDKVersion, voila..problem fixed. Go figure.. :(
android:minSdkVersion="17"
android:targetSdkVersion="17" />
Make sure to check your build.gradle and that it doesn't use a newer SDK version than what is installed on your AVD. That's only if you use Android Studio though.
My solution was to change the run configurations module drop-down list from wearable to android. (This error happened to me when I tried running Google's I/O Sched open-source app.) It would automatically pop up the configurations every time I tried to run until I changed the module to android.
You can access the configurations by going to Run -> Edit Configurations... -> General tab -> Module: [drop-down-list-here]
I found that making the recommended change in the manifest didn't solve my problem.
The fix was found in the GradleScripts folder, in the build.gradle file for the Module:app.
Inside this file (build.gradle) the following line was modified.
minSdkVersion 22
I changed this '22' value to '19' for my particular phone and the build completed without error.
Mate, my advice is to change virtual device. Download "Genimotion" application, its easy to use and there are a lot of any devices you need
Go in your project's build.cradle file and add
defaultConfig {
minSdkVersion versions.minSdk
}`
This makes it that your application conforms to the minimum SDK your device is running.
In our case using Flutter, some of our plugins required minimum API level 23 (Android 6.1) due to which several old devices could not install our app . For example, a Huawei Android 5.1 device could not install the app as the Flutter project's several plugins demanded minimum API 23 or Android version 6.1 .
To make a solution in such a case:
Either, remove those plugins to make your app compatible with old phones
Or, keep using high-API-required Flutter plugins that may lose old-device users .
If you are totally new like me, you must install the minimum SDK at first. Check the link.
This worked out perfectly for me:
Same problem other post with a good solution
Ionic Android emulator error INSTALL_FAILED_OLDER_SDK
So, basically it means that the installation has failed due to having an older SDK version than the targetSdkVersion specified in your app (it's a Gradle issue).
Just edit the AndroidManifest.xml file and add the following code:
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="14"/>
After days looking for the solution, that's it.
Works fine for me!
If the error "Installation error: INSTALL_FAILED_OLDER_SDK" appears, you must change the version of minSdkVersion in AndroidManifest to the one specified in the android emulator: see Settings -> About phone -> Android version.
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.2/knockout-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="14"/>
I've changed my android:minSdkVersion and android:targetSdkVersion to 18 from 21:
uses-sdk android:minSdkVersion="18" android:targetSdkVersion="18"
Now I can install my app successfully.