React Native SDK runtime permission error - android

React Native running android says the new target SDK 22 doesn't support runtime permissions. The old target SDK 24 does though, so how do you fix it?
Image of Error

Uninstall old version of your app.

Change the following attributes in the file [project path]/android/app/build.gradle ,
........
.........
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.kotac"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
.................
.............
as needed

Related

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"
}

Cannot find PROCESSED_RES output for Main

Getting this error while building android app bundle -
Cannot find PROCESSED_RES output for Main{type=MAIN, fullName=debug,
filters=[], versionCode=-1, versionName=null}
I have just added a dynamic feature module in existing android studio project, Getting this error while building android app bundle
change versionName and versionCode increment with every release
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.company.app"
minSdkVersion 16
targetSdkVersion 28
versionCode 14 // increment with every release
versionName '1.4.8' // change with every release
}
}

Gradle related error

I have recently started using the android studio. Just after installing and downloading all the requisite files, I am welcomed by this error,"Failed to find the target with the hash string 'API 27'....", whereas I already have both API 27 and 28 installed (although 28 shows up to be partly installed).
I am completely new to this software.
Tools
SDK
error
you should use like below in gradle
{
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig {
applicationId "xxxxxxxxx"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
}
don't write like compileSdkVersion 'API 27' its compileSdkVersion 27 only

Cannot install platform plugind for android-28 in Android Studio 3.2 preview version

I'm trying to refactor my code to androidX. To do so android asked me to update the compiled version to at lease 28. So I changed my compiled version to compileSdkVersion 28 in bulid.gradle.
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
But once I sync project I'm unable to download the platform plugins and the following error shows up in build window.
Failed to find target with hash string 'android-28' in: /Users/work/Library/Android/sdk
Your compile version should be android-p. They're using the version name now.
compileSdkVersion 'android-P'
And target should be just P
targetSdkVersion 'P'
See here to know how to set up Android P SDK.
Edit:
If your getting an error/warning "minSdkVersion (21) is greater than targetSdkVersion (1)" this is done on purpose, see here.
As Android P is still Preview, the 'P' in the targetSdkVersion will work as a version 1. Once it's out of preview it will be replaced with the usual 28. For now, to fix this you'd need to raise the minSdkVersion to also 'P'.

Android Gradle settings

I'm very confused with gradle versioning settings. I found some information about this build system, but nowhere was written about versioning details. Can you explain what these options mean?
compileSdkVersion
buildToolsVersion
minSdkVersion
targetSdkVersion
The minSdkVersion is most obvious, because it means the minimal API we want to support, e.g. 14 (Android >= 4.0).
The targetSdkVersion:
This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version.
I don't quite understand that.
My case is to support devices from API 15. What are the proper settings for that?
I read somewhere that target should be the highest as possible, Android Studio tells me that too, but when I set this up and try to run on Nexus 5 I get:
Failure [INSTALL_FAILED_OLDER_SDK]
My build.gradle
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "my.package.name"
minSdkVersion 14
targetSdkVersion 'L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
According to official doc:
http://developer.android.com/preview/setup-sdk.html#createProject
if you would like to try out new features you should use these values:
compileSdkVersion is set to 'android-L'
minSdkVersion is set to 'L'
targetSdkVersion is set to 'L'
It is the reason of Failure [INSTALL_FAILED_OLDER_SDK].
If you don't need android-L I suggest using these values:
defaultConfig {
applicationId "my.package.name"
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
Said that, there is an unofficial workaround described here (in any case I suggest that you don't use it)
Failure [INSTALL_FAILED_OLDER_SDK] Android-L

Categories

Resources