Failure [INSTALL_FAILED_OLDER_SDK]| - android

I do not find an answer. help!
I can not emulate my app that I get the error title .. all my information from the device and project is as follows:
Choose Device:
samsung GT-19300 Android 4.3(API 18) ---> No, minSdk(API 20) > deviceSdk(API 18)
build.gradle:
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "app.bluezone.win"
minSdkVersion 20
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
AndroidManifest.xml:
<uses-sdk android:minSdkVersion="20" android:targetSdkVersion="22"/>
What should I do?

Instead of changing the minSdkVerison & targetSdkVersion in build.gradle
Just open the Manifest file and use this
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="21"/>
Ref : Android Studio : Failure [INSTALL_FAILED_OLDER_SDK]

Can you please try with below code
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "app.bluezone.win"
minSdkVersion 17
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
also remove sdk stuff from manifest file
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="21"/>

Related

use a compatible library with a minSdk of at most 16

Hi I am trying to build detox to test my app. I am facing compatibility issue. My app runs with android versions 21 to 31. I get the below error when I run the command "yarn detox build -c android"
Error:
Task :react-native-midnight:processDebugAndroidTestManifest FAILED [androidx.vectordrawable:vectordrawable-animated:1.0.0]
/Users/user/.gradle/caches/transforms-2/files-2.1/5677f0d1d2fd33816116c626e2dd87f1/vectordrawable-animated-1.0.0/AndroidManifest.xml
Warning:
Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0,
androidx.vectordrawable:vectordrawable:1.0.1.
/Users/user/projects/MyWorkspaceapp/node_modules/react-native-midnight/android/build/intermediates/tmp/manifest/androidTest/debug/manifestMerger10963475594834660155.xml:5:5-74
Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.65.2]
/Users/user/.gradle/caches/transforms-2/files-2.1/b7e25968130290bea6922f5b0f7f24b0/jetified-react-native-0.65.2/AndroidManifest.xml
as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.facebook.react" to force usage (may lead to runtime failures)
See http://g.co/androidstudio/manifest-merger for more information
about the manifest merger.
build.gradle:
ext {
compileSdkVersion = 31
targetSdkVersion = 31
minSdkVersion = 21
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
// buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 21
targetSdkVersion 31
multiDexEnabled true
}
}
AndroidManifest.xml
> <uses-sdk android:minSdkVersion="21"
> android:targetSdkVersion="31"
> android:maxSdkVersion="31"
> tools:overrideLibrary="com.facebook.react" />
Add the below line in build.gradle. It works
subprojects {
ext {
compileSdk = rootProject.ext.compileSdkVersion
minSdk = rootProject.ext.minSdkVersion
targetSdk = rootProject.ext.targetSdkVersion
}
afterEvaluate { subproject ->
if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
}
}
}
}
}

minSdkVersion is newer than the device API Level error while installing app

I am installing Android app with target sdk version android S in Android phone with Api level 30. My default config settings for app is like
compileSdkVersion 'android-S'
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 21
targetSdkVersion "S"
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
But when I install the apk in Emulator with Api Level 30 I am getting error as
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_OLDER_SDK
The application's minSdkVersion is newer than the device API level.
How to resolve this ? Which things need to be modified to make it working ?
targetSdkVersion "S"
Using a prelimary version the minSdkVersion becomes S too automatically.
Changing to this version worked
compileSdkVersion 'android-S'
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Crash on using Zbar library in my application . Showing error when scanning QRcode

Error:
libiconv.so: has text relocations ,
libzbarjni.so: has text relocations
check error in view
I got the same error messages when testing my app with Android 6.0. I solved my issue by checking the targetSDKVersion in the manifest file. Using "22" and not "23" as targetSDKVersion solved it.
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="22" />
I also checked the build.gradle files for compile version and targetSDKversion:
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId 'com.android.live'
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName '1.0.0'
multiDexEnabled = true
}
Follow me and solve this problem permanently! (Works well targetSdkVersion 25, buildToolsVersion '25.0.3', compileSdkVersion 25)
1.Download the latest ZBar project here
2.grab the latest .so from barcodescanner/zbar/src/main/jniLibs, and replace the relative .so in your project.
3.Run your app!

Method for arguments with gradle in android studio

Syncing the project files with gradle files in android studio is resulting in the following error
Error:(14, 0) Could not find method applicationId() for arguments [com.amazon.mysampleapp] on project ':app' of type org.gradle.api.Project.
where the gradle file reads
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
applicationId "com.amazon.mysampleapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled = true
}
What is happening here? Removing applicationID moves the error to minSdkVersion
The applicationId doesn't go inside the android block, but instead your buildConfig block:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "19.1"
defaultConfig {
applicationId "com.example.my.app"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
}
Pulled that from this page about applicationId: http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename

My app's minSdkVersion is 14 and targetSdkVersion is 21 but Google Play judge it just support Android 4.0~4.4

compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "me.drakeet.seashell"
minSdkVersion 14
targetSdkVersion 21
versionCode 80
versionName "2.2"
}
Above code is in my gradle.build, and my app run perfectly in Android Lollipop (5.0), so I am puzzled that why Play judge and limit it just support Android 4.0~4.4, why not 5.0+?
Thanks!
I have fix it.
just add:
maxSdkVersion 21
in the gradle.build nearby minSdkVersion.

Categories

Resources