I have seen this same thing posted quite a few times, but whenever I try to import my project to my new work laptop I keep getting this error.
I have pulled the project from git (which his btw running fine on my old laptop).
Then I went to the sdk manager, downloaded all the tools, and all the SDK's available.
In the welcome screen, I went to Configure -> project Defaults -> Project structure.
Android SDK Tab says the path for projects without local.properties will be /Applications/Android Studio.app/sdk
This is correct.
Under SDKs I have all the available SDK's visible.
Project SDK is set to API 18
Yet still I get this error when trying to build my project.
Can anyone tell me where I havent looked yet?
I am running gradle 1.7 when trying to build which is downloaded from services.gradle.org
I had very similar situation (had a project on another machine and cloned it to my laptop and saw the same issue) and I looked in it.
Error message was coming from Sdk.groovy of Android gradle plugin:
https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/internal/Sdk.groovy
By looking at code, its findLocation needs to set androidSdkDir variable and there are only three ways to do it:
create local.properties file and have either sdk.dir or android.dir line.
have ANDROID_HOME environment variable defined.
System.getProperty("android.home") - I'm not sure how it works, but it seems like a Java thing.
While your Android Studio knows that the SDK is at that place, I doubt that Android Studio is passing that information to gradle and thus we're seeing that error.
I created local.properties file at the project root and put the following line and it compiled the code successfully.
sdk.dir = /Applications/Android Studio.app/sdk/
creating local.properties file in the root directory solved my issue
I somehow lost this file after pulling from GitHub
this is how my local.properties file looks like now:
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Sat Feb 06 11:53:03 EST 2016
sdk.dir=/Users/****/Library/Android/sdk
I found the solution here:
http://xinyustudio.wordpress.com/2014/07/02/gradle-sdk-location-not-found-the-problem-and-solution/
Just create a file local.properties and add a line with sdk.dir=SDK_LOCATION
If none of the answers work for you which happened to me on macbook pro in one of the projects you can always try to run Android Studio with an alias command passing sdk.dir with each run:
alias studio='launchctl setenv ANDROID_HOME '\''/Users/username/Library/Android/sdk'\'' && open -a '\''Android Studio'\'''
To fix this problem, I had to define the ANDROID_HOME environment variable in the Windows OS.
To do this, I went to the System control panel.
I selected "Advanced system settings" in the left column.
On the "Advanced" tab, I selected "Environment Variables" at the bottom.
Here, I did not have an ANDROID_HOME variable defined. For this case, I selected "New..." and:
1) for "Variable name" I typed ANDROID_HOME,
2) for "Variable value", I typed the path to my SDK folder, e.g. "C:\...\AppData\Local\Android\sdk".
I then closed Android Studio and reopened, and everything worked.
Thanks to Dibish (https://stackoverflow.com/users/2244411/dibish) for one of his posts that gave me this idea.
Had the same problem in IntelliJ 12, even though I have ANDROID_HOME env variable it still gives the same error. I ended up creating local.properties file under the root of my project (my project has a main project w/ a few submodules in its own directories). This solved the error.
specifying sdk.dir=<SDK_PATH> in local.properties in root folder solved my problem.
I clone libgdx demo, can't import project. it also reminds like this.
Env:
Eclipse(Android-ADT)
window 7
so I create local.properties file at the project root, like following
sdk.dir = D:/adt-bundle-windows-x86/sdk
I hope this can help others!
Copy and paste the local.properties file from a project you created on your new computer to the folder containing the project from your old computer also works too if you don't want to (or know how to) create a new local.properties file.
I noticed that I get this error when I'm working on a new computer if I try to build from the command line first. However, if I build from Android Studio, it retrieves the SDK and creates the directory automatically. Then when I build from the command line it works.
You have also to ensure you have the correct SDK platform version installed in your environment by using SDK Manager.
If you have cloned a project from GitHub for example, and you've tried the methods mentioned here without success including:
Editing sdk.dir in the local.properties
Trying to set ANDROID_HOME environment variable
Or adding an alias as kasiara mentioned
You should try to see if you are trying to build a directory project that is a part within a bigger project, and so it may cause problems.
So load the entire project, and then run the project directory you'd like.
In my specific case I tried to create a React Native app using the react-native init installation process, when I encountered the discussed problem.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\Users\***\android\local.properties'.
I add this, because when developing an android app using react native, the 'root directory' to which so many answers refer, is actually the root of the android folder (and not the project's root folder, where App.js resides). This is also made clear by the directory marked in the error message.
To solve it, just add a local.properties file to the android folder, and type:
sdk.dir=C:/Users/{user name}/AppData/Local/Android/Sdk
Be sure to add the local disk's reference ('C:/'), because it did not work otherwise in my case.
Related
I'm building app using different ways, two works but one fails.
Method:1 (Working)
flutter build appbundle
Method:2 (Working)
Opening module in Android Studio, after that, choosing
Build > Generate Signed Bundle/APK... > filling all info afterwards
In this case, I am able to build both app bundle and APK file.
Method:3 (Not working)
flutter build apk
I get this error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android_intent'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
If I remove android_intent, I start getting error in other packages, so definitely the package isn't a problem. I double checked that I have
local.properties, gradle.properties and settings.gradle in my android root folder.
And my other projects seem to work.
I have faced this issue with file_picker plugin, Just upgrade gradle version in android/build.gradle to one of these versions :
3.3.3
3.4.3
3.5.4
3.6.4
4.0.1
I followed this link : file_picker troubleshooting
I recommend clearing the android-studio-dir and android-sdk settings, and let flutter automatically detects their path instead: This works for me .
flutter config --android-studio-dir=""
flutter config --android-sdk=""
Sometimes you will see an SDK problem from a plugin that requires the latest gradle to actually run.
I was running into this even though my SDK was properly set:
SDK location not found. Define location with sdk.dir in the
local.properties file or with an ANDROID_HOME environment variable.
More info from:
Here is an example of a plugin failure that will lead to an sdk and query error flutter_file_picker:
Build is failing with unexpected element <queries> found in <manifest>.
Upgrade gradle:
To upgrade gradle in a flutter project, File -> Open and select the Android folder which is part of your Flutter application. When that finishes loading, it will prompt you to upgrade gradle to the latest version. This will resolve the issue
I had the same problem.
In my case, an outdated package was the cause of the problem
To fix this issue try to upgrade the Gradle version to the latest version.
For doing this go to android/gradle/wrapper/gradle-wrapper.properties and then, replace the version of distributionUrl with the latest Gradel version.
for example:
upgrade:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
to:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
I was facing the same issue but there is a file create in
build\app\outputs\apk\release\app-release.apk
which when installed works fine without any issue . Even I don't know why this happens but it works.
So in my case what I feel is happening is that there is a conflict between the new build and the already existing build due to a new package or something else so I did
flutter clean and tried building again and voila it worked.
In android\gradle.properties make sure android.enableR8 is NOT set to false. It may just be related to your apk size, not a specific package.
I had the same issue. Here how I solved it.
Make sure you have a file called local.properties in android folder, and make sure it has a correct Computer user name such as like that:
sdk.dir=C:\\Users\\YOURUSERNAME\\AppData\\Local\\Android\\Sdk
flutter.sdk=C:\\src\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.5
flutter.versionCode=10
for MAC, path should be like that
sdk.dir = /Users/YOURUSERNAME/Library/Android/sdk
In case if this doesn't work, add ANDROID_HOME variable in "Environment Variables" as C:\Users\YOURUSERNAME\AppData\Local\Android\Sdk
in mac os.
open terminal and run below command
nano ~/.bash_profile
type below values in terminal with your user_name
export ANDROID_HOME="/Users/<user_name>/Library/Android/sdk"
export ANDROID_TOOLS="/Users/<user_name>/Library/Android/sdk/tools/"
export ANDROID_PLATFORM_TOOLS="/Users/<user_name>/Library/Android/sdk/platform-tools/"
and save them by control+X and then Enter
after that restart terminal and type below command
source ~/.bash_profile
finally type
echo $ANDROID_HOME
I have to do it on my project folder then it worked for me.
I recently tried to import sample Android games I downloaded from Google's developer website. After importing them into Android Studio, I'm getting the following error:
Error: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
What is this? I want to run the sample programs from Android Studio.
Please follow the below steps:
Go to your react-native Project then go to the android directory
Create a file with the following name:
local.properties
Open the file and paste your Android SDK path like below:
For windows users:
sdk.dir=C:\\Users\\UserName\\AppData\\Local\\Android\\sdk
or (for newer versions of Android Studio / IntelliJ IDEA):
sdk.dir=C\:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk
Where USERNAME your PC user name. Also, make sure the folder is sdk or Sdk.
Example:
sdk.dir=C:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk
or:
sdk.dir=C\:\\Users\\USERNAME\\AppData\\Local\\Android\\Sdk
For Mac users:
sdk.dir = /Users/USERNAME/Library/Android/sdk
Where USERNAME is your OSX username.
For Linux (Ubuntu) users:
sdk.dir = /home/USERNAME/Android/Sdk
Where USERNAME is your linux username (Linux paths are case-sensitive: make sure the case of S in Sdk matches)
In case this doesn't work, add ANDROID_HOME variable in "Environment Variables" as C:\Users\USER\AppData\Local\Android\Sdk
The project might be missing a settings.gradle file. Make sure that file exists from the project you are importing. If not add the settings.gradle file with the following :
include ':app'
Save the file and put it at the top level folder in your project.
You have to just copy your local.properties file to the folder where project is stored and it will work like charm. But remember, it must be placed in the root folder where the project is stored.
Please follow bellow points it work's for me:
Go to your Project -> Android
Create a file local.properties
Open the file
Paste your Android SDK path depending on the operating system:
4.a Windows
sdk.dir = C:/Users/USERNAME/AppData/Local/Android/sdk
4.b Linux or MacOS
sdk.dir = /home/USERNAME/Android/sdk
Replace USERNAME with your user name
Check out in your local.properties file
sdk.dir=C\:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk
properly write this format, and also check / slas using for path
This problem is encountered when you try to import an Android Studio project from the ../app/build.gradle file.
Import the project by selecting the ../build.gradle file located in the root directory of your project.
Here is a work around for the problem when you click "Run App" (green arrow) and get the following in the Edit Configuration dialog:
Error: Please select Android SDK
In Android Studio, do:
From the menu, choose File > Settings.
In the settings dialog, go to Appearance & Behavior > System Settings > Android SDK.
Look at the top for Android SDK Location, and click the Edit button
Hit Next, Next, Finish to accept the defaults
This seems to save away the SDK location - even though nothing has changed - into some internal location. I inspected the .idea and .gradle folders but didn't see what Studio did to change a config file - but now I can run the app.
And to summarize the previous fixes - these are normally OK for a repo without build problems:
local.properties file is copied into the root folder by Studio.
The path in the local.properties file has the correct path to the android SDK - in my case it is sdk.dir=C:\\android\\sdk
(note that this path has a different format - Studio should write this file for you based on the Text Entry field in the Android SDK Settings dialog)
settings.gradle file is present in the repo - and references the application folder (typically :app)
I came across the same issue but a little bit different error message is
SDK location not found. Define location with an ANDROID_SDK_ROOT
environment variable or by setting the sdk.dir path in your project's
local properties file at "xxx"
MAC & ReactNative
Add local.properties
Find your Android SDK location
/Users/yourMacUserName/Library/Android/sdk
Create local.properties under rootProject/android/local.properties.
Add sdk path into it
sdk.dir = /Users/yourMacUserName/Library/Android/sdk
This normally works, but if you are working in a team with other team members, then yourMacUserName is different.
OR
Set ANDROID_SDK_ROOT variable
Edit your ~/.zshrc or ~/.bashrc or ...
Add SDK path:
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
Open a new terminal tab or source ~/.zshrc
echo $ANDROID_SDK_ROOT to test the print correct SDK path.
Alternatively, you also can add your path
export PATH=${PATH}:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools
to use some useful commands.
Go to your React-native Project -> Android
Create a file local.properties
Open the file
paste your Android SDK path like below
in Windows sdk.dir = C:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk
in macOS sdk.dir = /Users/USERNAME/Library/Android/sdk
in linux sdk.dir = /home/USERNAME/Android/Sdk
Replace USERNAME with your user name
Now, Run the react-native run-android in your terminal
or
Sometimes project might be missing a settings.gradle file.
Make sure that file exists from the project
you are importing.
If not add the settings.gradle file with the following :
include ':app'
Save the file and put it at the top level folder in your project.
If you have this problem when you pull a react-native project, you just need to open the android project with Android Studio. Everything you need will be automatically created.
Open Android Studio
File -> Open
Choose the android folder under your react-native project folder
Wait for AndroidStudio to complete setup
You can now close Android Studio
OR
If you have installed the AndroidStudio command line launcher:
Run this in your react-native root folder
studio android/
Wait for AndroidStudio to complete setup
You can now close Android Studio
In Linux:
If you have already downloaded the android SDK but its not being found.
The problem might be that the file local.properties needs to be inside the same directory as gradle stuff for gradle to find it when building and running adb.
For my react-native project using gradle I needed to put the local.properties file to Myprojectname/android/ folder.
As I had unzipped the SDK to Downloads so I just use that path in the file with a row like this:
sdk.dir=/home/USER/Downloads/android-sdk-linux
I resolved this issue by creating ANDROID_HOME environment variable as follows in windows.
ANDROID_HOME=C:\Users\<user_name>\AppData\Local\Android\sdk
Restart Android Studio it should build project!
If you are trying to run Google android sample code, try to import the entire repository instead of an individual sample.
Here is instructions.html, included with the Google Calendar API sample code.
Import calendar-android-sample project
Select "Import Project..." or File > Import Project...
Select [someDirectory]/google-api-java-client-samples/build.gradle and
click OK.
Note: it will not work if you try to import [someDirectory]/google-api-java-client-samples/calendar-android-sample/build.gradle
Select "Use local gradle distribution" with "Gradle home" of [someDirectory]/gradle-2.2.1 and click OK.
Just Remove .idea folder and import the project again. It's worked for me.
There is not a single reason for this error.
settings.gradle may be missing or the content in it may be wrong.
local.properties may be missing or the sdk path may be wrongly written.
Go to the android folder and create local.properties files and paste your SDK path
In my case I was using linux and putting double quote around the path inside local.properties like
sdk.dir = "/root/Android/Sdk/"
export ANDROID_SDK_ROOT = "/root/Android/Sdk/"
So it should be
sdk.dir = /root/Android/Sdk/
export ANDROID_SDK_ROOT = /root/Android/Sdk/
and .bash_profile
I had this error in flutter so i fixed it by going to android->app->build.gradle
and changing targetSdkVersion from 28 to 29 and compileSdkVersion to 29 from 28 and it worked for me
create a local.properties file in your root directory of your project with the following content
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Tue Oct 24 17:40:53 CEST 2017
sdk.dir=/Users/****/Library/Android/sdk
put these two lines in your .bashrc file and run source ~/.bashrc
export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
For linux I did this.(For the first line)
export ANDROID_HOME=/home/$USER/Android/Sdk
In my case, I had to close Project and open again. It worked fine.
Like This
Close Project
And again Open Project Again
Follow followings steps :
Create a file under 'android' folder with name 'local.properties'
Add this line in file 'local.properties' as
sdk.dir=/Users/bijendrasingh/Library/Android/sdk
Add here your android sdk path.
There can be two different possibilities :
1). Either you SDK location is incorrect in local.properites file.
2). Or the file is missing, this can happen if you have cloned a project, so just create a local.properites file under Gradle Scripts foler, and then set up the sdk path.
Set up the correct sdk path like this :
sdk.dir=YOUR_PATH_TO_THE_SDK
For mac users the path should be:
/Users/USER_NAME/Library/Android/sdk
For windows users the path should be:
c:\Users\USER_NAME\AppData\Local\Android\Sdk
For Mac/Linux users
You need to add ANDROID_HOME to your path, add the following to your .bashrc || .zshrc || .profile file
# change $HOME to the path where you installed android Sdk
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
Then run
$ source ~/.bashrc || .zshrc || .profile
Environment variables in bash_profile or bashrc?
Difference between .bashrc and .bash_profile
This solution actually works for me..
go to this pc -> properties -> advanced system settings -> environment variables ->
then in system variable create new variable with name ANDROID_SDK_ROOT and value C:\Users{USERNAME(Replace it with your username}\AppData\Local\Android\Sdk
and make sure that if real android mobile using usb debugging is enabled. (very important)
then close cmd and restart it should work.
the best and the easiest way is to create new Android project move "app" folder from non working project to that newly made one and add the needed dependencies in the gradle of your new project and everything will work perfectly )
I got this error after freshly cloning a repository. I expected local.properties to be generated automatically, but it wasn't. I was able to generate it by re-importing the Gradle project.
File > Re-import Gradle Project
If all else fails, copy the local.properties file to the root of the project directory. Simply.
Anyone using Jenkins, might get it useful
You need to define a global variable name ANDROID_HOME with the value of the path to android sdk.
For mac, it is /Users/YOUR_USER_NAME/Library/Android/sdk
I had a situation where I already had the local.properties file set up but I was still getting this error. Turns out, if your project has a submodule, you have to copy the local.properties into the submodule folder as well.
I have just imported my eclipse project in android studio. it keeps my saying that
Error:SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
I have seen some tutorials of editing local.properties files but it didnt work. here is my project.properties file:
sdk.dir=E:\\Mod Eclipse\\adt-bundle-windows-x86_64-20130219\\sdk
Actual directory of my folder is :
E:\Mod Eclipse\adt-bundle-windows-x86_64-20130219\sdk
A quick note about this if trying to run a Facebook sample and this error pops up, make sure you select the build.gradle file in the root of Facebook sdk, for all the samples when 'opening an existing project'. I got this error when I tried to open the gradle for just the Scrumptious sample from the 3.22 SDK
If you are sure that you have assigned correct SDK path in project settings,
and you can see it in local.properties as well, but still getting this error then there are chances that you are missing something in you project.
I was getting the same error after looking in to my project I found settings.gradle was missing.
and then add following script to your apps build.gradle
You will not face this error any more. It worked for me may be gradle set up was the blocking issue
My problem was:
I cloned a project from github
I clicked open existing Android Studio project
I chose the path of the inner sample app instead of the containing folder.
So what you should do is:
close the project.
click open existing Android Studio project
select the parent folder instead of the sample app.
You should also change it on Project Structure.
Close the current project and you'll see pop up with dialog which will then proceed to Configure option.
Configure -> Project Defaults -> Project Structure -> SDKs on left column -> Android SDK Home Path -> give the exact path as you did on local.properties and select Valid Target.
There you go.
The simplest solution sometimes is just do the File -> Invalidate Cache / Restart.
If it does not help then go for the more complicated stuff, as suggested in other answers
You can add a local.properties with to set the sdk.dir like sdk.dir=/Users/roofe/Library/Android/sdk.
But please note below, which is very important,
add the local.properties to the uppermost path of the project. Here the uppermost have some difference with root path of a project.
For example in the below project, I just use the ijkplayer-example, but this module also used other module with different cpu architecture.
If I only add local.properties to ijkplayer-example will not work. Here will get sdk location issue for other module.
While I can add the local.properties to the ijkplayer directory, then when I try to open the ijkplayer-example project, there will auto create a local.properties for ijkplayer-example, and everything works well.
In my case, it was a fresh install with checkout from github.
Just close the checkout window.
Create a new project (not from git, just a fresh one).
exit the project.
checkout whatever you like
Its just the fastest way that I found.
So I had the same issue, and none of the answers given previously helped me. What I did was check for new API updates (in my case, I updated to API level 23) and the problem was fixed.
Sync project with Gradle files, It will modify the project's local.properties file.
In Android Studio, I just clicked on File and then Choose Project Structure or Ctrl-Alt-Shift+S. This'll clearly show you the Android SDK location and an input box where you can browse to the correct one if it is not correct.
I add just local.properties file where my project is located. In local.properties:
sdk.dir=C\:\\Users\\dglig\\AppData\\Local\\Android\\Sdk
such kind of path is there which is our Sdk path.
So just create local.properties file manually and inside this just copy the Sdk file location.
Probably local.properties file missing.
Copy a local.properties from an existing file and add it to your current project. That worked for me.
I installed the SDK again (from here for example :
https://www.mediafire.com/file/azbsqg6dmg7z7np/Sdk+tools+for+android+studio.rar/file
& it created the directory & the packages, after installation.
Now I open android studio & everything is normal.
Everything posted so far was helpful in an overall learning capacity. However, most of the time, fixing one problem created others. What ended up working for me was completely deleting the GitHub project .zip file and any unzipped files. Then I made sure the correct .zip file was re-downloaded and unzipped. When it came time to open it in Android studio, I noticed there were 2 folders with identical project file names, one being contained in the other. The first (or upper) one is actually the .zip file. Open the other one!
After I updated form 0.2.2 to 0.2.3, I create new project failed.
Error message is below:
下午 08:51:58 Gradle 'NotifyViaGoogleMapsProject' project refresh failed:
The SDK directory 'C:\Program Files (x86)\Android\android-studio\bin\Program Files (x86)Androidandroid-studiosdk' does not exist.
Build file 'F:\AndroidStudioDevelop\NotifyViaGoogleMapsProject\NotifyViaGoogleMaps\build.gradle' line: 9
NotifyViaGoogleMapsProject is my project name,and my android studio is install in default path(C:\Program Files (x86)\Android\android-studio), there has no same error in 0.2.2.
I've figured out the problem.
Open 'local.properties' in your project using a text editor.
sdk.dir=..\\sdk
Save and Close
Now Import your project into Android Studio.
Make sure that the SDK folder you mention exists - I'm not sure if it is a typo or not but the path you specified is a bit weird - it should be
C:\Program Files (x86)\Android\android-studio\sdk
On the menu go to File -> Project Structure, then choose SDKs under Platform Settings. Check that the path for the Android Platform you use is correct, and if not, change it to the correct path. Also make sure that the Project is set to use the correct Android Platform.
I have the same problem.
http://i.stack.imgur.com/pPOOi.png
The SDK is correct in Platform Settings, I have no idea what's causing this problem.
http://puu.sh/3TAFi.png
Today i was update my android sdk to new android adk-17 .
i am facing some problems in this, that is unable to show AddMob in my app, if i remove addmob in the code able to run the app without any errors otherwise not. what is the solution for this, is this bug in new sdk.
this is the Logcat information
Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader
dalvik.system.PathClassLoader[/data/app/com.veritra.iflipout-1.apk]
Maybe the ADK update has messed-up with your project's build-path.
Try removing the admob JAR and add it again to your libs folder, add it to your Build Path and do a Clean Project.
Anyway it's hard to help you without more details on the error you encounter.
EDIT following poster's comment about not having a libs folder:
You should try this:
Remove all references to the AdMob JAR in your project -> your code should not build without error anymore
Create à libs folder at the root of your project
Copy the AdMob JAR into the libs folder
Make sure this AdMob JAR is in your Build Path (this will allow your code to build wihtout error)
(If still not running OK) Right click your project > Android Tools > Fix Project Properties
The 'problem' here is that the SDK is a lot more strict about the libraries. If you do not check the library as 'exported' in eclipse, it is not added to your APK, leading to this nasty class not found exception. You should mark your libraries as exported.
Project Properties | Java Build Path | Order and Export
when I updated my SDK it was total mess. Well, the only I had to change was the PATH in Environment Variables.
http://developer.android.com/sdk/installing.html :
Adding both tools/ and platform-tools/ to your PATH lets you run command line tools without needing to supply the full path to the tool directories. Depending on your operating system, you can include these directories in your PATH in the following way:
On Windows, right-click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path (under System Variables). Add the full path to the tools/ and platform-tools/ directories to the path.
On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ and platform-tools/ directories to it. If you don't see a line setting the path, you can add one:
export PATH=${PATH}:/tools:/platform-tools
On a Mac OS X, look in your home directory for .bash_profile and proceed as for Linux. You can create the .bash_profile if you don't already have one.