Android Studio with compileSdkVersion 16 don't compile on Mac - android

I have used linux for a while, and now I'm on Mac.
I use Android Studio and I want to compile my old projects exported from Eclipse on linux. I have "repaired" gradle configuration to work on Mac, but I have some issues with compileSdkVersion setted on 16 (like I used on linux). My project give me some errors about appcompat-v7
Image link: (not sufficient points to post image) http://i.stack.imgur.com/uWj7f.jpg
When I set a bigger compileSdkVersion, it gives me about 5 errors, but I want to compile like on linux with version 16. What I need to do?
Regards!

To use AppCompat 23.0.1, you must compile with API 23.
Note that compileSdkVersion does not actually change any behavior in your app - that is what targetSdkVersion does.

Check your compilesdk version. It needs to be >= to the support library version. E.g if you use appcompat version 7.23, then use compileSdkVersion 23

Related

How to change default sdk version in Android Studio in windows OS

Whenever I create sample for eg:login template in android studio the project is getting created in android sdk version 23, I want to change this for all projects created in future.How to change the sdk version of android studio. Changing gradle settings after creation of project wont help since all the UI elements will be created for sdk23.Please suggest a solution.
You can change it from
your module level build.gradle file
compileSdkVersion 23
minSdkVersion 15
targetSdkVersion 23
change these values and rebuild your code.

Android Studio appcompat library missing again

I have installed Android SDK tools 22.0.1 and 23.0.3
I want to target SDK version 22.
After chasing previous posts here, I found that people got this to work
compile 'com.android.support:appcompat-v7:22.2.1'
However, I am still getting:
Failed to resolve com.android.support:support-v4:22.2.1
So, I add version 4, then I get same error, twice (below each other)
Which is the latest appcompat support library? Where do you find out the latest version?
This is really frustrating...
Thanks
I have installed Android SDK tools 22.0.1 and 23.0.3
That is irrelevant with respect to using appcompat-v7.
I want to target SDK version 22
Assuming that you mean that you want your targetSdkVersion to be 22, that too is irrelevant with respect to using appcompat-v7.
Which is the latest appcompat support library?
Right now, it is 24.1.0.
Where do you find out the latest version?
In your specific case, go to the Android SDK installation on your developer machine. In there, go to extras/android/m2repository/com/android/support/. In there, you will see directories with the names of all the pieces of the Android Support library (e.g., appcompat-v7/). If you go into any of those, you will see the versions that are available to you.
Now, what is disconcerting about your error messages is that you are getting a failure on support-v4, for a version requested by an appcompat-v7 that apparently is found (otherwise, your error would be for appcompat-v7). This suggests that you do not have all of the Android Support library pieces, perhaps due to a failed installation of the Android Repository from the SDK Manager.
What if I want to compile with SdkVersion 22?
That is not a particularly good idea for new development (vs. maintaining some legacy app). But, if that is what you want, you need to choose Android Support library artifact versions in the 22 series. On my machine, it looks like 22.2.1 is the latest of those.
The latest version is 24.1.0.
You can check it here: https://developer.android.com/topic/libraries/support-library/revisions.html
Change to
compileSdkVersion 23
buildToolsVersion "23.0.3"
and change
compile 'com.android.support:appcompat-v7:22.2.1'
to
compile 'com.android.support:appcompat-v7:23.4.0'
if you want to target sdk 22 add/change
defaultConfig {
//
minSdkVersion 16
targetSdkVersion 22
//
}
Although latest version is 24.1.0 but for that you have to update again from sdk-23 to sdk-24

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.

Android targetSDKVersion 19 but where is support library

I have
targetSDKVersion 19
and trying to use
compile 'com.android.support:recyclerview-v7:19.0.+'
is giving me an error failed to resolve ...
When I go to SDK Manager, I can only see Android Support Library rev 23.1.1 available for download.
If I use that version 23, then I have the error this support library should not use a different version ...
My searches only bring up the fact I need to install same version of support library as I have targetted SDK - however as above, I can't find it ?
The target SDK version and the version of the library must match. So rather than using the support library in version 19, upgrade your targetSDKVersion to 23 and also use the support library in version 23.1.1.
If that doesn't work out of the box, try installing the google support repository from the SDK Manager.
Try using this
compile 'com.android.support:recyclerview-v7:23.1.0'
and change your gradle file
minSdkVersion 19
targetSdkVersion 23

Why i can't compile my android project with other APIs

i want to build an android project for API 19 so i choose this API to compile with, but when eclipse create the projects its tells me that some ressources are not found and the R class is not generated. the only way to avoid this errors is to compile with API21
So why i can not use my API 19 in compilation ??
THNKS for all
Compile SDK Version can and should always be set to the latest SDK released. It is target SDK version that you should set to the latest version you've tested your app on.
Eclipse by default includes AppCompat - the part of the Support Library which ensures a consistent look and feel across all API versions v7+ and the newest version, revision 21, compiles against API 21.
So why i can not use my API 19 in compilation ?
be sure to have the api installed:
Window -> Android SDK Manager

Categories

Resources