ADT Eclipse imports cannot be resolved - java

I'm working on some Android projects for school and I brought them home to work on over the weekend. I downloaded ADT/Eclipse on my desktop here and picked the folder my projects are in as the workspace.
When I open up the classes in the project to work I just see loads of errors in the code, which stem from errors shown in the imports like
import android.content.Context;
Imagine error marks under "android.content". It's like this with all of imports and when I hover over them the little window says "The xxxx.xxxx cannot be resolved". I'm currently API 19 on my desktop here.
What's the problem here?
Oh, and another thing: in the little console tab-window it says "Unable to resolve target 'android-18'". Could this a cause?

Well if you have ADT installed, you probably don't have API 18 installed. You can install it from the SDK manager in Eclipse.
Another option is to change the app to compile with API 19.
Right click your project > Properties > Android > Select the version to compile with

You should install latest ADT Bundle from Android official website that is available at :http://developer.android.com
and after downloading , don't extract it to desktop , instead extract it to the folder where you have installed Java JDK(java Development Kit). Because PATH might be the problem..

Related

How to set eclipse for android development?

I just downloaded java JDK 8 and set the environment variables for JDK and JRE, downloaded android SDK extracted them directly to C: (there were no platform tools so I used the command line to download them) and also set the environment variables. And I downloaded eclipse oxygen and I installed new software for ADT Plugin. When I set preferences I referred to the SDK folder and hit apply but nothing seems to happen like no SDK targets are listed. Hhuhuhuhuhuhuhu T^T I have deleted everything from Java, SDK, eclipse and downloaded them all again while disabling my antivirus but that didn't fix it. I also cant open my Android SDK Manager using eclipse, like it shows that it's loading but after that nothing happens even if I wait for 10 mins nothing shows up on screen, not even the command line that seems to just flash briefly which is what most people are having problems with when I search google. Can someone please tell me what to do?? I'm mainly using eclipse for android projects in school
By the end of 2015, Google ended the development and official support for the Android Developer Tools (ADT) in Eclipse.
As stated by Google, every app development project should be migrated to Android Studio.
So you should migrate your eclipse project to android studio.

Java android development starting

I wanna start with android programming. I am using eclipse and installed Android SDK. Then in eclipse i installed ADT Plugin, and after that installed every tool and file for 4.2(Jelly Bean) from SDK manager and also installed all extras from SDK manager (expect Intel x86 Emulator Accelerator - because i use AMD). Then when i create android application project i get this problems:
First, wizard for creating project is not closing after i click finish but it creates app (can see it in package explorer)
Second, i get errors in MainActivity and Values>styles.xml - In console it gives me errors No resource found that matches the given name 'Theme.AppCompat.Light', No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'., No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar', and these errors show in about 15 lines.
I tried adding appcompat-v7-24.2.0.javadoc.jar and appcompat-v7-24.2.0.source.jar files in Java Build Path (project settings), but that doesn't work either.
I really do not know what to do. Before i was using Eclipse Neon, and i even tried installing Eclipse Standard and reinstalling android SDK and ADT, but doesn't work. So please at least try to help me. Thank you in advance :)

Trying to setup phonegap "Hello World!" project

Guys i am following this tutorial
but unfortunately, i am not able to configure it, I have stuck at this section:
"Open a Project in the SDK" .
After importing the project in Eclipse it shows 64 errors, most of them are related to packages like:
Description Resource Path Location Type
The import org.apache.cordova.ConfigXmlParser cannot be resolved WhitelistPlugin.java /MainActivity/src/org/apache/cordova/whitelist line 23 Java Problem
Edit:
Ok, I have followed this link:
http://docs.phonegap.com/en/edge/guide_platforms_android_index.md.html#Android%20Platform%20Guide
and skipped "Open a New Project is SDK".
and directly execute these commands in "cmd":
cordova build
cordova build android
cordova emulate android
It shows in cmd:
INSTALL SUCCESS
Unlocking Screen
Launching Application
LAUNCH SUCCESS
but in simulator there is no application launched.
Please guide me.
Thanks.
First the doc your're following is for an old version, you should have a look at the newest version : http://docs.phonegap.com/en/edge/guide_platforms_android_index.md.html#Android%20Platform%20Guide
Secondly, do you really want to open the project in eclipse? That's really not something needed unless you need to do some native dev in your app.
You probably can ignore the "Open a Project in the SDK" section and just use the CLI to build and run your app.
If you really want to use eclipse, I think you have this errors because you only imported your app but not the cordova libs. When you use the "Android project from existing code" wizard, make sure you select the platforms/android directory and then select all the projects, especially the CordovaLib project.
And last but not least, you probably don't need phonegap and should use cordova instead. I don't know why phonegap is still refering to eclipse. Cordova now recommends using Android studio instead and maybe importing in eclipse doesn't work anymore with latest versions of cordova/phonegap? check cordova docs here : http://cordova.apache.org/docs/en/edge/guide/platforms/android/index.html
Ok,
I found the work around from this link
I installed the "Blue Stak App Player" and after running this command:
cordova run android
It successfully installed and worked in "Blue Stack".
Thanx.

How do I set my Java SDK when creating an Android project in IntelliJ?

I'm trying to get an Android project running in IntelliJ by following the JetBrain instructions here but run into an error message when trying to Select the Project Template (step #2). The error is
"Cannot Create SDK
You need to configure a Java SDK first".
I'm doing this on a mac and followed the first page of instructions before the ones linked above. In particular:
I ran the command tools/android update sdk --no-ui from the terminal after downloading only the Android SDK content. I mention this because it says to "run the SDK Manager", but I see nothing of the sort in what I've unpacked. Running the aforementioned command downloaded and installed many Android API versions and revisions.
The JDK I downloaded was jdk-7u17. I installed it; is that all I need to do?
The error for "configure a Java SDK first" comes up when I press the "New..." button in step 2. Does anyone know how I can configure my Java SDK? Is there something I missed or that is missing from the JetBrain instructions?
EDIT: Apparently, a file browser comes up after clicking OK. This confuses me further, as it accepts setting my JDK location but what I want is to view an Android project. My Android SDK is in the folder named "android-sdk-macosx", but that's not bringing up the Android options when it's selected. How do I get to the Android templates?
Have you downloaded some of the Android SDK's? Try running tools/android sdk (this opens the SDK manager) and download one of the SDK's. Then add this to your project.
Have a look at the IntelliJ documentation, which explains how to setup your SDK.
You have to setup a JDK first (see also Setting up JDK 7 for IntelliJ on the Mac), then you will be able to open your Android project.

Unable to find Android SDK location for setting preference Eclipse

To start Android Development I installed..
JDK 7
Downloaded and installed Eclipse in E:/ Drive on Windows 7
Then following the steps, installed Android ADT using Eclipse.
Everything fine till now but on trying to set preference its not accepting any folder.
On looking other suggestions online i founded that there is some setup a C:\Program Files\Android\android-sdk but no such folder in my case.
Is my android-sdk in E:/ Drive instead of C:/
I just got a folder (after ADT installation) :
E:\Software\JAVA Tools\eclipse-mobile-juno-SR2-win32-x86_64\eclipse\plugins\com.android.ide.eclipse.adt.package_21.1.0.v201302060044-569685
i can't find any 'tools' folder even (as eclipse preference requires)
Don't know what to do. Please suggest me something
Hello please follow the simple steps to install eclipse and Android SDK there is an ADT-bundle so it consists of all like
1) Eclipse where u no need to install
2) Android SDK ,
3) ADT Plugins
So u simply Click on eclipse it will load automatically all like Android SDK and ADT plugins. So please follow the link to download the adt-bundle.
Note : Before that please install JDK .
My friend, who will install ANDROID SDK? It neither comes with JDK or Eclipse. Please go through these for proper setup link1, link2

Categories

Resources