Andorid Studio 2.0 Preview 5 Error during launch - android

the error log goes to
Error installing split apks: com.android.ddmlib.InstallException: Failed to finalize session : -26: Package here.is.packagename new target SDK 22 doesn't support runtime permissions but the old target SDK 23 does.
update project build.gradle targetSdkVersion = 23 will solve the error, but I don`t know why?

You can't downgrade from an app using targetSdkVersion 23 to one using an older targetSdkVersion, as the error says.
Instead, you must fully uninstall the targetSdkVersion=23 version of the app from the device. After that, you'll be able to install the app targeting an older version of Android.

Related

unable to upgrade old react native project with API level 28 to API level 31

I have a 2 year old react native project created based on version 61.5 having API level version 28. Now I am trying to upgrade it. I have upgraded the gradle version to latest, react native is also upgraded, solved the issues that came in. My target version change are as follow
buildToolsVersion = "30.0.3"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
supportLibVersion = "31.0.0"
when I run react-native run-android app builds successfully, installs it in emulator, but I am getting the error as shown in the screenshot, because it doesn't suggest where the error is to be able to figure out the root cause. And if I run "yarn start" the app loads and works properly.
Does anyone have experienced this kind of issue? Can any one please suggest how to get more insight into the error message to find which file is causing it.

How can I change the defined API version of an Android app?

I am absolutly new in Android development and I have the following problem trying to build a sample project that I have downloaded from Internet.
When I try to build it I obtain the following error message:
Error:Cause: failed to find target with hash string 'android-18' in: C:\Users\Andrea\AppData\Local\Android\sdk
Install missing platform(s) and sync project
So I search online and I found this SO link: Android studio - Failed to find target android-18
Ok so I go into Tools > Android > SDK Manager and infact I have installed Android 6 corrisponding to the API level 23 but not Android 4.3 corrisponding to API level 18.
So what it means? It means that I have installed a different version o the Android framework ?(is it the SDK considerable as a framework or what?)
So, on Android Studio can I install different version of the SDK?
I think that the API level have to be defined in some way into the dowloaded application. How can I specify to this application to don't use the API level 18 but instead it use the installed API level 23 ? I think that it is not a problem because I have installed a newest version that have to support all the stuff of the oldest one, is it?
I will explain the problem a bit for you and then provide you with the solution.
You are facing this problem, because your project is targeting API level 18 to compile the project. So you MUST have API 18 SDK installed to compile the project.
This is why the IDE is complaining that,
Install missing platform(s) and sync project
The SDK is not the framework. The Android framework is same all over, but with different API levels new updates are pushed to the SDK, the latest being API 23, Marshmallow.
You should not download an older SDK to compile the project.
Always try to use the latest SDK available to work with. So, just head over to your build.gradle file or AndroidManifest.xml file and change the compileSdkVersion to 23.
You can either change the compileSdkVersion version in build.gradle to 23 or whatever version you have in your local machine
You can obtain the API Level 18 from the SDK Manager.
I go into Tools > Android > SDK Manager and infact I have installed Android 6 corrisponding to the API level 23 but not Android 4.3 corrisponding to API level 18.
So what it means? It means that I have installed a different version of the Android framework ?
Yes, you have a newer version of the SDK.
on Android Studio can I install different version of the SDK?
Yes, that is what the SDK Manager is designed for
I think that the API level have to be defined in some way into the dowloaded application. How can I specify to this application to don't use the API level 18 but instead it use the installed API level 23 ?
It is defined. Check either the AndroidManifest.xml or the build.gradle file in the module for the app (not in the project root). You should see some combination of minSdk, targetSdk, and/or compileSdk with a number after it. Since you are getting an error about missing SDK 18, then that number will be 18.
I think that it is not a problem because I have installed a newest version that have to support all the stuff of the oldest one, is it?
The support libraries are separate from the core SDK. You cannot run SDK 23 specific code on devices that have a version less than 23, therefore, to be safe, it is recommended that you start with downloading SDK 18, then run it, then try updating the compileSdkVersion number.

Cordova build for android level api 20

I am trying to build an app made with Angular2 + Ionic2 (ie. Cordova 6) for my android 4.4.4.
I have noticed the version 4.4.4 of android was reffered to the api level 20, so this is the version I have downloaded and installed (api20 + android SDK Build Tools level 20 too). In cordova I have edited the platforms/android/project.properties and platforms/android/CordovaLib/project.properties to build to android-2O instead of the default android-23 api. I have also edited the AndroidManifest.xml.
The issue comes when I try to compile my project with cordova build android, cordova executes some CordovaLib:instructions UP-TO-DATE and bug on CordovaLib:compileDebugJavaWithJavac..
According to the error report which is :
platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:25:
error: cannot find symbol import android.webkit.ClientCertRequest;
^ symbol: class ClientCertRequest location: package android.webkit
At the end of all the error report it also says :
You may not have the required environment or OS to build this project
Error: Error code 1 for command:
platforms/android/gradlew with args:
cdvBuildDebug,-b,/Users/thomas/Documents/www/MyProject/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
So I come here to ask for help, because I have no idea what is wrong with Cordova and android-SDK...
Thank you to everyone who helps ;)
Bye !
When you build for Android there is targetSdkVersion and minSdkVersion.
targetSdkVersion indicates wich version of the API will be used to compile the program, not wich version of Android must be on the device the program will be run on.
minSdkVersion indicates the minimum version of android a device must have to be compatible with your program.
If you downgrade the targetSdkVersion, you are limited to older functions and if your program uses the newer functions it will fail to compile (I think it's what happens if you try to compile a Cordova version designed for API 23 with API 20).
By default Cordova (at least for the version 5.1 of cordova-android) uses the targetSdkVersion 23 and the minSdkVersion 14, which means programs should work on devices runing Android Ice Cream Sandwich (4.0) or newer.
In your case, all you have to do is install SDK 23 and don't touch anything to try to change the target SDK.

How to downgrade project sdk from 23 to 21 in android studio 1.4.1 without getting error?

I just started install android studio this year and i get a default sdk of 23 everytime i open my project. However, i would like to downgrade it to sdk 21. But i have been getting error from other java file. How should i solve this matter? I have been following from this tutorial "Changing API level Android Studio". However after gradle sync, the error come out

Android version downgrade

Please I am trying to build a small android app with ionic but I downloaded android SDK 5.1.1 .
I wish to deploy to a device that has android version 2.3.3 but it won't even build .
It keeps telling me that the target app is android-22. I want it to build for a lower version like android-8.
Please any help will really be appreciated.
I only want it to be able to build for a lower version
I tried to edit the version in the androidManifest.xml files on my project but still I get errors
->First of all, let`s make sure you have downloaded the plateform for Android 2.2 using Android SDK Manager.
->Set android:minSdkVersion to 8 in androidManifest.xml
->Verify the BuidTarget attribute, since it specifies the development tool of which api to provide you.
->Your problem seems to be the absence of API8 in your SDK.
you might need to change your minSdk in build.gradle
in the app build.gradle file set the min sdk version as 8.
defaultConfig {
applicationId "com.etrade.mobilepro.activity"
minSdkVersion 8
versionCode 87
versionName "4.5"
}
Since the app is not building I guess you don't have that particular sdk.I would suggest downloading the sdk through sdk manager.

Categories

Resources