cannot resolve android symbol - android app - intelliJ - java

I am using intellij-idea to develop android app. I created a project with an android module, but none of these :
import android.app.Activity;
import android.os.Bundle;
are recognized, I get cannot resolve android symbol. I googled this issue but none of the remarks I found there seems to debugg my problem

What you should do is,
1. Select your android project
2. press ctrl +alt + shift + S
3. Select SDK from the project settings
4. Check the files under the class path tab
5. There must be android.jar ,res ,annotations.jar
Probably there should be missed one or several files in step 5.
Then,
6. Go to Android SDK home path field and add your SDK folder again
files even though you have all the jars and still you are getting the error ,then remove all the jars from the class path and add them again ( like in step 6).
7. Build menu -Rebuild your project.
Now your errors should disappear.

i have the answer guys
1- press ctrl+alt+shift+s
2-in the Modules bar click on your project name
3-change the compile sdk version to the newest one
4-click apply and ok then sync your project
5-done , i hope the best for you

Basically, this is because you didn't add Android SDK.
So you need to add android SDK.
go to Files and select project structure.
go to project and select the project SDK
click New and select Android SDK version

Related

Android SDK is not specified in multi-module project

I cloned a multi-module project from the Github with the following structure,
It has 5 modules like android, angular-client, design-impl, hub-spot-email and lastly, loan-calc-service. The moduels hub-spot-email, and loan-calc-service are the Spring boot app. When I tried to build at the first time, I get the pop-up to set the output path for the project,
Then, I have set the hub-spot-email/controller package as the output path (endpoint). This is the path set for the project,
/Users/Somename/IdeaProjects/eclipxgroup-master/hub-spot-email/src/main/java/com/quotecrunchers/email/controller
I have tried again to build and I get the error,
Error:Android Source Generator: [eclipxgroup-master] Android SDK is not specified
I have installed the Android SDK. The installation setup is correct as I checked earlier. In the next try, the error doesn't go away. I assume I need to set some path for the android module. I went to the preference section which seems like,
Also, the Java SDK is properly set though I get the error sings to the left of the files,
While I have some experience with the java and Spring xxx, I couldn't figure out what I need to do to build the project. Do you have more information what I need to do?
Note
So far I only managed to set the Android SDK for the project.

"The import java.util cannot be resolved" for OpenCV2.4.8 Android SDK

Last night I was fed up with the slow debugging of AVD and somewhere I found about HAXM. Which is basically hardware acceleration support. SO-LINK Shows how to install it for ADT. All went fine until I restarted ADT and then I started to get the error on java.util in one of the OpenCV sdk files. Screen below shows the error.
How do I fix this problem. I hope it had nothing todo with HAXM!
Any help much appreciated!
Go to Project Properties -> Java Build Path -> Libraries.
Remove the Library "Unable to get system library for project".
now select Android from left menu -> tick the appropriate version of android under Project Build Target.
Click on apply and then OK.
Now clean your project.
Right click on project -> Android tools -> Fix Project Properties.

Error - The import com.google.android.gms.ads cannot be resolved

I follow instruction from Google developpers but i have a problem. I want display publicity ( with AdMob ) and Google Play Game services on my application.
I display publicity with success and it's work ( I use google play services lib ). But when I want to add the BaseGameUtils library to use Google Play Game Services, I have an error.
My import which work previously doesn't works after the new library import.
The import com.google.android.gms.ads cannot be resolved
I don't remove google play services lib so why the error appears ?
Thanks
Go to your java build path, under project tab add your lib and then under order & export tab tick your lib, apply settings.
At last just clean the project and lib, it should work properly...
First solution: Right click error and select the Fix project setup like below image.
Select google-play-service.jar right path and click ok
Second solution: Delete android-support-v4.jar file under libs folder after restart
eclipse.
Change the version of the library in the build.gradle(:app) file to
"com.google.android.gms:play-services-ads:19.2.0".
This did the trick for me
Make sure that your library is in your build path.
I had the same problem with another lib.
I solved this error by downloading the latest version (15 as of today) of the Google Play Services.
Then import it again as a library in your project.

Android: Eclipse can't build projects

days ago I opened ADT and it suggested to update 2-3 things. I did without even looking what they were, and after it all gen folders are empty. I have about 40 little projects, and they all don't have R and BuildConfig classes. I can't create a new project, "Compile With: " field stays empty. When I open "Android -> Properties -> Android" then everything is empty there, no Project Build Target and n o Library, and no possibility to add.
I cleaned many times, Built manually and automatically, insatlled Build Tools in SDK Manager. no error in any layout file. what else to do? Help please.
There are two parts to the tools necessary to build an Android project, the version numbers of each part need to match. I suspect that from your description, that you have only updated one, namely the Android SDK Tools
To check the version of this component, click on the Android SDK Manager icon in the toolbar and in the popped up window you will probably see "Android ADK Tools rev 22.6.2" near the top.
Now check the other necessary part, (the plugin), version number by selecting Help, Install new software, click 'what is already installed". At the top you will see the 4 plugin Android components. These need to be version 22.6.2 as well. If they are not then add the repository https://dl-ssl.google.com/android/eclipse and update it if necessary.
In Eclipse , Open Android Sdk Manager and install or update required Android SDK Build-Tools .
Then restart Eclipse .
Goto windows -> preferences -> android -> sdk location and browse your updated sdk and ok.
Hope this will solve your issue
Eclipse has Android SDK manager option Top on left side.
go to Android SDK Manager and Install Android API packages.
I had same problem yesterday and this is how I solved it :
1.Check if your SDK Manager Works if it says that tools folder is missing it means you dont have any SDK installed if you have then go to : Window -> Preferences -> Android -> and browse to find SDK in my case it is ...Documents\ADT\adt-bundle-windows-x86_64-20131030\sdk then click Apply to refresh if it found sdk chose it then do same for your project to make sure it has sdk assigned to use and about R In each class u will have to go to import section and delete R import because eclipse changed it to R.android, then just import your R. class. If that doesn't help please list more information and what you tried so far.
Good luck

Android SDK Eclipse AndroidManifest.xml not created

I've downloaded the ADT Kit from the Android Developer Website, but if I try to create a new Project (New-> Android Application Project), the Manifest file is not created. In the console window, I get the message:
'[2013-12-13 15:50:08 - package name] AndroidManifest.xml file missing!'
How can I solve the problem?
I already tried to clean the Project and run again, but the xml file isn't created. I tried also to uninstall (delete) the SDK and download it again, but there is the same mistake.
I found the solution:
First, I Updated my SDK, but it wasnt the problem. The problem was the character 'ö' in the project / package name. Eclipse didn't create the Manifest because of him.
It's a German App...
To fix this problem, right click the project or edited resource and select “Refresh”.
If you edit outside of Eclipse a lot, you can enable auto-refresh by going to Window->Preferences menu, then in the Preferences dialog box, select General > Workspace.
Check the “Refresh automatically” box.
and even in the eclipse in the top menu bar you can find search-->check the automatically build

Categories

Resources