Missing annotations.jar - android

I am trying to update my Android SDK Tools to 17 rev. and I updated usign SDK Tools but in Properties/library ;
But the fact that in the support folder there is a annotations.jar already.
What should I do to fix it?

So, when i updated sdk to L version i had same problem. But after Extra folders updating in SDK Manager i didn't find annotation.jar file. Maybe Google bug with new SDK version. So i copied annotation.jar file from old SDK folder (folder half a year ago)

I had the same problem. I went to the SDK Manager within eclipse (Window --> Android SDK Manager) and installed the Android Support package which is found in the Extras folder. After the install the error was gone (at least in my system)

Right click onto your project, in context menu choose Properties, your will see a window.
Second line is Android - click onto it.
You will see list of installed SDK.
Check any SDK which has API level 16 or more.
annotationas.jar is embedded in SDK of 16 API level and after it.

What worked for me was downloading the annotations.jar file, and then adding that to where it was supposed to be according to the error.
It can be downloaded here: http://mvnrepository.com/artifact/com.google.android/annotations/4.1.1.4

After updating all of the packages in the SDK manager you may need to update Android Developer toolkit also. Eclipse -> Help -> Check Updates -> Install

I think Google has changed the location of that jar file from <SDK_DIR>/extras/android/support/annotations.jar to <SDK_DIR>/extras/android/support/annotations/android-support-annotations.jar
To solve this issue, I followed these steps on all projects and libraries in my workspace using this jar:
Just removed the file from Java Build Path -> Libray Tab,
then Add External Jars
Chose file from the given location above.

I had this issue just now, and this was the top result in Google. Posting my results for time-traveling Googlers from the future.
Jose's solution didn't work for me, as there was no "Extras" folder, nor "Android Support" package, in my update manager, so things must have changed within the past two years.
Here's what did work for me: update all of the packages in the SDK manager. I don't know which update in particular fixed it, but now that they are all up-to-date, the problem is solved.

Related

Unable to resolve target 'android-17'

I know there are some sort-of duplicates of this, but none of the answers have been able to help me so far.
When I open a project, I get the following error:
[2014-01-07 14:18:00 - Permissions] Unable to resolve target 'android-17'
Does anybody know what may be the problem here?
You can right click on your project -> properties -> Android -> Select the Target android version you want to compile and Apply !
If you don't have any target versions to compile, you probably need to download them on your SDK Manager
Open your Android SDK Manager, and make sure your SDK API is installed
You might have several Android SDK folders installed, like me; check that your workspace build path is the one your machine defaults to.
You are probably trying to use a library that was built using API 17 and you do not have it installed. If you are using API 18+ you will be fine.
goto your sdk manager.exe open it, check the API 17 checkbox and click the 'install x packages' button, this will download and install these packages, if the project still shows error go in your project build path and fix the library path error if any
Sometimes the error can appear when you are working with source code built with an ADT that is a higher version than what you are currently using. It could be worth it to see if ADT has a later version than you are working. Sometimes ADT (especially with Eclipse. Link to get new here: https://developer.android.com/sdk/index.html) cannot find updates when asked to find them so you may need to install the newest version and overwrite/delete the old version
The target API in project.properties may be different from the one you have installed. This may happen if you reinstall Eclipse, for example. Open the Android SDK Manager and check to see which version of the API you have installed. Then go to project.properties and set "target=android-xx" when "xx" is your API version.
It's very simple:
Click Android SDK Manager
Download Android 4.2.2 (Api 17)
After install Android 4.2.2(Api 17)
Click right on project --> Properties --> Android --> Target Build Target
Choose Android 4.2.2 Api 17.
Finish

Android Eclipse Support Library: Required version blank

I have just downloaded and installed the latest ADT Bundle for Windows available from the Android Developer website. Following this, I installed all the packages in the SDK Manager, including the 'Android Support Library Rev. 18'. Finally, I installed the latest ADT through the 'Help > Install New Software...' menu in Eclipse.
I have strictly followed the following guide to create my first project:
http://developer.android.com/training/basics/firstapp/creating-project.html
But by the last step, I arrive at an error, showing the Support Library revision I have installed, and a required version of -blank-:
http://i.stack.imgur.com/CScNj.png (sorry, I can't post images yet)
I have checked through 'Window > Preference' that Eclipse is pointing to the right SDK directory. Mine contains the directories: add-ons, build-tools, docs, extras, platforms, platform-tools, samples, sources, system-images, temp, tools - I assume this is correct.
I have read elsewhere about moving files from \extras\android\compatibility to \extras\android\support, however I do not have the 'compatibility' directory. Additionally, my support folder contains the folders: samples, v4, v7, v13 - if that means anything (I assume the problem lies somewhere in here). I have installed the packages in the Android SDK Manager with admin privileges, and have tried creating an android project in Eclipse with admin privileges too.
Not sure where to go from here. Has anyone else experienced this error and can point me in the right direction?
Actually this appears to be an actual bug in the SDK tools: https://code.google.com/p/android/issues/detail?id=60149
see #55 for a workaround without having to downgrade the SDK tools.
You may temporarily downgrade to previous version: just download http://dl-ssl.google.com/android/repository/tools_r22-windows.zip and extract it to your "..Android\android-sdk\tools" folder.
It solved the problem in my case.
UPDATE:
As #DogGuts suggested, a better way is to download correct templates from here and replace files in "\Android\android-sdk\tools\templates\activities"
And the best solution is update SDK to 22.2.1 version :)

Android R.Java not Generating even when new project is created

I know This Question has been asked multiple time here, i already have been through many of them.
I tired every solutions which were provided by the experts.
my problem still persist.
I my case R.java file is not generated even when a new project is created.
even after cleaning and rebuilding also.
Please help me out.
Thanks
Make sure there are no error in your .xml files where they refer to another which is non-existent
Make sure you don't have any upper case letters in your file names.
I am also facing the same kinds of problems but after so much of searching i have found that when cleaning the project in the cleaning window select the option "Build Only Selected Project" At the bottom of the Clean window.
The Same problem happened to me also,May be you updated the eclipse.
1.Check that Android SDK Build-tools is installed. Window->Android SDK Manager->Tools->Android SDK Build-tools
2.Make sure when you update the Android SDK Tools, you also update the Android SDK Platform-tools and Android ASK Build-tools. Build fails silently if they don't match.
Solution
1.Update Android SDK Tools and Android SDK Platform-tools and Android SDK Build-tools from Android SDK Manager (Window->Android SDK Manager->Tools->Android SDK Build-tools).Then restart the eclipse.
follow the following steps::
connect internet to your system(3G internet connection will be preffered)
start eclipse.
Open SDK Manager
see at top of sdk manager window
Check Android Sdk Build tools
click on a button a right bottom corner "install 1 package".
wait untill package installs
after installing ,restart eclipse
Now your issue will resolve certainly

Android Studio - SDK is out of date or is missing templates

I downloaded Android Studio, fixed the JDK Environmental Variable, but when I try to create a New Project, I get an error that says
Your Android SDK is out of date or is missing templates. Please ensure you are using SDK version 22 or later.
I opened up android.bat in the SDK but it said I was already running version 22.
Anyone else getting this?
It just happened because you already have your SDK setted up for Android Developers Bundle with eclipse. Simply open your SDK manager in the ADT Bundle and update you Android SDK Tools from 21.1 to 22 and you are good to go.
Worked for me.
First of all, on Windows and Mac, the individual tools and other SDK packages are saved with the Android Studio application directory.
Windows: \Users\<user>\AppData\Local\Android\android-studio\sdk\
Mac: /Applications/Android\ Studio.app/sdk/
Make sure your android-sdk-path is correct and the sdk tool version is 22 or later.
Then open the Configure--> Project Defaults --> Project Structure, set your project sdk is Android SDK.
enjoy.
As for me, I make next:
Start Eclipse -> start SDK -> install selected packages
Eclipse -> Help -> check for updates -> update all
Android Studio -> configure -> Project Defaults -> Project structure -> Press plus -> Android SDK -> put path to the same sdk that you use in eclipse (run SDK and in top panel you can see this path).
Apply
I did all of the above and still got the ....missing templates blah blah. What worked for me was to go to Configure>Project Defaults>Project Structure>Project and select Android SDK, then Configure>Project Defaults>Project Structure>SDKs map the Android SDK home path to the sdk folder in the ADT bundle (for me it was C:\Users\home\Toolbox\adt-bundle-windows-x86\sdk).
I then selected Android 4.1.2 clicked apply and it worked.
I then went back to the Configure>Project Defaults>Project Structure>SDKs and then selected Android 4.2.2 and now that worked too (strange though as when I selected Android 4.2.2 first time the Apply button was grayed out)
I ran into this problem because I wanted to update from an old version. In doing this, I downloaded the latest version from the Project Tools Site, then unzipped and copied over my existing Android Studio install which did have the sdk folder inside.
Going back and looking at it, I see quite plainly that there was a note that I previously ignored:
NOTE: These .zip files do not contain an embedded SDK install. If you have an existing install of Studio which contains an embedded SDK, if you upgrade by installing one of these zips, make sure you copy over the SDK as well.
For OS X users, this means going to your old version of Android Studio (if you haven't copied over it yet) and right-clicking and selecting Show Package Contents, then copying the sdk folder that's inside, then putting that into the new version of Android Studio.
If, like me, you already copied over the old version, then you'll need to redownload the old version first which does contain the SDK.
They released a new sdk today. You need to update to it.
I was still hitting this, and figured it was due to something I had misconfigured (which turned out to be the case). The error message is a little confusing, too, because I believe that they are referring to is the version of the ADT tools, not the SDK. For example, the version of Android 4.3 (which is about the latest) is 18.
As of the latest source for Android Studio (which you can clone from here: https://android.googlesource.com/platform/tools/adt/idea), that message is generated from NewProjectWizard.java at about line 75 if TemplateManager.templatesAreValid() is false. And it checks that by looking for the existence of the file [rootTemplatesFolder]/gradle/wrapper/gradlew .
It gets the [rootTemplatesFolder] from the SDK(s) you specified in the "Project Structure" settings for default projects. In my case, I had several specified - both the new ones pointing to the sdk directory that's (thankfully) part of the Android Studio, and a few old ones I had somewhere else. I should not have included the old ones at all, but I'm a newb to this and the GUI let me do it. The NewProjectWizard was checking the tools area of that one first, which did not have that file, since the tools version with it was older than version 22.
I had to use dtruss to watch the system calls of Android Studio to see where it was looking for that file, at which point I could tell what my silly problem was.
I have a few more notes on this, including a screenshot of my particular misconfiguration, at http://www.nowherenearithaca.com/2013/08/solved-android-studio-and-your-android.html
Note: It seems you have to restart Android Studio for the "New Project Settings" here to take effect.
for ubuntu:
Open sdk manager from Android Studio or configuration.
make sure you download or update the latest release SDK and build tools.
Set the sdk location as (your android folder/sdk)
It'll download and install sdk
just Update sdk with sdk manager
it worked for me

How to downgrade my SDK Version?

I made a stupid mistake by upgrading my SDK version to r15 as the android repository was not loading. How do I revert back to my older version r10?
Or is sticking with the newer version better? I'll have to upgrade my ADT Plugin as well then.
Thanks a lot.
Anyway, for those who want to downgrade Android SDK Tools to a previous version, it can be possible following these steps:
Find your Android SDK folder
Locate the "tools" subfolder and rename it to "tools1" (just to keep a backup copy of the original tools folder)
Likewise, rename platform-tools to platform-tools1
Download from google repository the SDK Tool version you want to downgrade to (for instance: http://dl-ssl.google.com/android/repository/tools_r22.6.2-macosx.zip) and unpack it.
The ZIP file you downloaded contains a tools folder that has to be moved to your Android SDK folder.
Likewise, download the platform tools (for instance: http://dl-ssl.google.com/android/repository/platform-tools_r19.0.1-macosx.zip), and extract it in your SDK folder.
That's it.
I want to follow up on the great answer provided by Ariel Iriarte, step 3 (Download from google repository the SDK Tool version you want to downgrade to).
To find the old tools, you need to determine the SDK version number that you want to revert to. On the Google Android SDK webpage, you will find a Revisions list that shows all the SDK numbers, e.g.
SDK Tools, Revision 22.6.2 (March 2014)
SDK Tools, Revision 22.3 (October 2013)
etc.
Make a note of the exact revision number, like "22.3".
Now download the tools by using the following pattern:
http://dl-ssl.google.com/android/repository/tools_rXXX-windows.zip
http://dl-ssl.google.com/android/repository/tools_rXXX-linux.zip
http://dl-ssl.google.com/android/repository/tools_rXXX-macosx.zip
where you must replace XXX with the exact revision number noted above. For example, to download revision 22.0.5 for Mac OS X, download the file:
http://dl-ssl.google.com/android/repository/tools_r22.0.5-macosx.zip
Once you download the file and unzip it, you will find a single folder called 'tools'. Now follow the answer by Ariel Iriarte and replace your android-sdk/tools folder with this new one. This is the folder that contains stuff like:
NOTICE.txt
adb_has_moved.txt
android
ant
apps
ddms
dmtracedump
etc.
Some of you probably found this thread due to the unstable versions of Android-Tools pushed (exclusively) since the stable 22.3 version. This causes a 'hang' in the emulator on the "Android Animation / Splash Screen" in Intel API's pre Version 19, and a "floating point exception" for Intel API-19. The ARM versions still work, though more slowly on Intel machines using acceleration.
To answer the questions of "how to find the older versions not listed in the GUI" - or present in the current xml which feeds it (https://dl-ssl.google.com/android/repository/repository-8.xml), in the comments above, I have no idea how they can be located (please enlighten me).
Fortunately, someone reporting the bug did post a direct link to the Linux and Windows versions of the stable 22.3 version in this thread:
https://code.google.com/p/android/issues/detail?id=66786
... which are:
http://dl.google.com/android/android-sdk_r22.3-linux.tgz
http://dl.google.com/android/android-sdk_r22.3-windows.zip
These also exist in unofficial locations on the web, should those get pulled down, along with the now-gone references to them.
After extracting that archive, you will have the "Tools" folder you need to replace the broken one, as per Ariel Iriarte's instructions above (though I renamed the existing 'Tools' folder something involving the letter 'f' - days into this problem).
In order to prevent this problem from re-occuring, do NOT count on the built-in method in Eclipse / Android-SDK to revert to a previous installation, nor for the older-versions of any file provided by Google to be available At All, Ever, in the future. Backup your entire 'android-sdks' tree prior to installing anything.
You can install multiple SDKs, and set the default SDK by editing the properties on the Android project.
The simple solution is :
1- Go to your graddle-wrapper.properties then change this line as you desire :
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
2- Go to File>Project Structure>Project then Change both Gradle version and Gradle Plugin Version
3- then Sync your Project
Done.

Categories

Resources