I find that if I do not explicitly specify buildToolsVersion in build.gradle, it will use a very old version even if I have since uninstalled it. I must manually specify the version to have it use the latest. Is there a way to have it always use the latest without having to manually update buildToolsVersion in every project?
Related
I want to know how to fix my compilesdk version to 33 in build.gradle(:app) file.
Whenever I create a project, I have to go to the gradle file and change the sdk version from 32 to 33.
this is so annoying routine for me.
Anybody know about this issue, please help me :<
-- I have attached some setting image
sdk manager
I unchecked Android SDK Platform 32. but when I create new project, 32 is automatically downloaded.
What did I try
Uncheck the other version in sdk manager window
Then create new project, unchecked version 32 is automatically downloaded
Whenever I create a project, I have to go to the gradle file and change the sdk version from 32 to 33.
The SDK version 32 is automatically added by the project template generator in Android Studio. It is usually increased after some time but not frequently. Its something you gotta learn to live with because not all developers prefer the newest SDK Version.
I unchecked Android SDK Platform 32. but when I create new project, 32 is automatically downloaded.
This happens automatically because of the reason above,you dont have to fight it.It is also a one time occurence.The IDE downloads the SDK source files only once. If you change the compile SDK to 33, it proceeds to download the source files for that version.
I don't get any description. I've reinstalled Android Studio, deleted whole android profile and cache but still it did't help.
Edit1 - Note: When new API's are released, the documentation is not always released with it. You need to check their update log to determine that.
Install the Sources of the API you are using.
The documentation will show up afterwards.
Steps:
Tools -> SDK Manager
Check "Show Package Details"
Check the required API Source
Wait for indexing to be finished.
When I faced this issue it was because the compileSdkVersion set in app build.gradle was only installed partially according to the SDK manager.
Installing the SDK for the compileSdkVersion fully fixed the documentation issue on Mac OS AS 4.0.1. This is accomplished by simply checking the checkbox.
To illustrate, on this image the documentation would work with compileSdkVersion set to 26 or 29, but not when set to 28 or 30.
Faced the same issue. Clearing cache doesn't seem to the trick.
The thing here is - Sources for Android 30 is not yet available in SDK Manager. So we need to use android 29 at least for development environment to see the documentation. Go through the following steps :
Download Sources for Android 29
Update the following properties in app/build.gradle file :
compileSdkVersion 29
buildToolsVersion "29.0.2"
targetSdkVersion 29
Can i delete the older versions of the gradle folder versions such as 2.0, 3.3 and just keep the latest version or are all of them required by Android Studio?? click to see all the gradle folders under wrapper
Yes, it is simply a cache.
You can always delete the downloaded Gradle versions, as the Gradle wrapper will redownload them if required.
However, if you don't necessarily need space on your disk, you can also keep them, so that they can be reused whenever a Gradle project with the specific version is executed. This way, you may save the time to redownload.
Is there way to have android studio automatically rebuild build.gradle?
I have a case where the compileSdkVersion is wrong (says 18, should be 22). I changed it in the AndroidManifest.xml file but that change did not propagate to the build file. I tried build-clean project, build-rebuild project to no avail.
Obviously I can change it by hand but I would prefer to see a solution that is more automatic and less prone to errors I might unwittingly introduce.
From the official Android page: http://developer.android.com/tools/building/configuring-gradle.html
The defaultConfig element configures core settings and entries in the
manifest file (AndroidManifest.xml) dynamically from the build system.
The values in defaultConfig override those in the manifest file. The
configuration specified in the defaultConfig element applies to all
build variants, unless the configuration for a build variant overrides
some of these values.
You should provide sdk version only in gradle.build file once. If you provide any sdk settings in AndroidManifest.xml it will be overridden by build system with the values in your gradle.build file.
If you create a new project in your latest Android Studio you will notice that Android doesn't put any API version related settings in manifest file anymore. They all go to gradle.build file.
I recently updated Resharper to version 9.0. Now I noticed that adding references by Resharper context menu does no longer update the packages.config file, thus breaking the match between referenced DLLs and installed packages.
For older versions of Resharper, this functionality was provided by a plugin, but the plugin does not seem to support Resharper 9.0. Also, I am unable to find something similar through the Resharper Extension Manager.
What is the correct way to add Nuget packages to packages.config when adding references with Resharper 9.0?
NuGet support was shipped as a bundled plug-in in ReSharper 8. Currently this plugin is still not adopted to ReSharper 9, so you have to wait till it will become compatible, sorry.
But it will become compatible relatively soon, hopefully.
Update: According to the creator of the plugin, this functionality will be shipped with Resharper 9.1, see this issue for the announcement.
That means with Resharper 9.0 we have to keep the packages.config in sync with the references manually.