Create new android application project in Eclipse - android

I tried creating a new android application project in Eclipse (4.2 for Java) with latest android sdk as per http://developer.android.com/training/basics/firstapp/creating-project.html
I enter the application name and the project name. The other values are default.
After I click on finish on the final step, the window of creating a new project is still open. I have to click on 'X' to close the window. In the project explore, the new project is created but all the icon in front of files are in grey and there is no src file.
Could anyone help please? Thanks!

It seems that your MainActivity.java in "src" folder is not created at all.
You'll need to update the ADT.
Go to following:
'Help'->'Install New Software' and type
https://dl-ssl.google.com/android/eclipse/
Select ADT option and install it.
It will update the ADT.
Even I had the same problem and my issue got resolved with it!!

Make sure you have these things:
Java SDK Latest (or most popular, which is Java 7 at the moment even though 8 is available)
ADT
Eclipse is updated (via menu...Help > Check for Updates)
Check JDK Path
Via menu...Window > Preferences > Java > Installed JREs > [Point to path]
path should be similar to this for
x64: C:\Program Files\Java\jre7
x86: C:\Program Files x86\Java\jre7
x64[JDK]: C:\Program Files\Java\jdk1.7.0_45\jre
x86[JDK]: C:\Program Files x86\Java\jdk1.7.0_45\jre
When creating Android projects in Eclipse Kepler use a minimum API of 14 because there seems to be a bug causing Eclipse Kepler to crash (Other related issues: AppCompat! )

Related

"Setup SDK" error display in new android studio 2.1.1

I just download the newest Android Studio from the developer site.
After installation I installed Android Studio, then I created new project and after project build completed, I opened my MainActivity.java file to find this error. Please refer to screenshot below:
I also downloaded Android SDK component which is built-in already in Android Studio.
Start Android Studio and invalidate cache File--> Invalidate Cache and Restart.
Rebuild your project. Try clean build. That should do. Faced a similar problem.
Tools -> Android -> Sync Project with Gradle Files
Build -> Rebuild
Incorrect installation of JDK also might cause problems. Please tell what the error is in detail.
You can try this for JDK Installation:-
On some Windows systems, the launcher script does not find where the JDK is installed. If you encounter this problem, you need to set an environment variable indicating the correct location.
Select Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.8.0_77.
Goto File -> Project Structure on left hand side click on SDK Location there you can find Android SDK Location and JDK Location. So, now locate your JDK path by browsing your JDK installation path. Click OK, Now goto Build -> Rebulid your project.
It's better to check whether the JDK path set in Environment variable by typing java -version in commmand prompt. If it is not set, set the path as DvD said in his post.
Hope this works for you.

What exactly is "tools.jar" in the Android SDK?

So, I've been trying to build a project in LibGDX for about 10 hours now. In case you'r unfamiliar, LibGDX is one of those platforms where you specify a project directory at the start, along with any required SDKs and then when you're ready to start coding it will generate a project for you.
Anyway, I've been having a problem where every time I try to build it fails with the single error message:
Execution failed for task :core:compileJava.
Could not find tools.jar
I'm guessing "tools.jar" is a package within the Android SDK, as this is the only repository needed to build, it doesn't ask for a JRE or even the Java SDK. just the Android SDK.
I have been looking in the SDK manager, I have installed all of the packages labelled "Android-SDK Tools", "Android-SDK Platform Tools" and "Android SDK Build Tools" but there is nothing else that includes "tools.jar", I am looking for some light shed on this topic as it is a very grey area. I would like to know where this .jar file comes from and what exactly it includes. Can it be installed from the Android SDK?
There have been similar questions like this before which only fit narrow situations, If someone could provide a holistic description of the tools.jar package it would benefit a great deal for me and everyone else that needs it in their 3rd-party android IDEs.
For the record, it's building with Gradle and my current SDK is well-equipped enough to build full-fledged apps in Android Studio.
Please don't answer this question with a question unless I have left out some information that is dire to finding an adequate solution
Try copying tools.jar from %JAVA_HOME\lib to Android Studio\lib
For me, copying tools.jar to Android lib folder alone didn't solve my problem.
But I also had to create a System Variable 'JAVA_HOME' in Windows Environment Variables with path to the latest JDK folder.
Restarted Android Studio, and this solved by problem.
My Android Studio Version: 4.2.1
The "tools.jar" is provided by Oracle JDK which is required by android studio for compilation - I have faced this issue after updating android studio to latest version in my PC.
To Resolve the issue follow below steps:
In Android studio File -> Project Structure -> SDKs (Under Platform Settings)
A) Add JDK path by pressing '+' symbol in middle pane if suppose JDK/JDK home path is not present in the middle pane already (Middle pane also contains the Downloaded Android SDK's)
B) Java sdk will be usually present/installed in the path
64 bit => "C:\Program Files\Java\jdk1.X.Y_ABC" (In my PC it is 1.8.0_202) or
32 bit => "C:\Program Files (x86)\Java\jdk1.X.Y_ABC"
If suppose you don't have JDK installed in your PC, please download and install from Oracle Java website
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
Set JDK and JRE Path(Download both from webpage mentioned in step 2) in system environment variable
A) Press windows key type "Edit the system environment variables" and open the application
B) Go to Advanced -> Environment Variables
Under system variables add JAVA_HOME and JRE_HOME as below
Set Windows system environment variable
Add jdk lib path on the Path environment variable under user variables (this step is required only if the error not resolves with the previous steps)
C:\Program Files\Java\jdk1.X.Y_ABC\lib
In my case, I have five jdk and some have tools.jar and other not, my solution is copy paste this tools.jar in all lib of jdk.
Nothing worked for me. So I Copied tools.jar and pasted it in C:\Users\UMAR_\AppData\Local\Android\Sdk\platforms\android-30 which is the path to the library for the Android API 30 Platform. I pasted tools.jar in every folder and it start working.
I didn't have tools.jar initially but followed this link and downloaded https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
Also added to a environment variable.. but what worked was in the first para, I still don't know if adding to variable was necessary or not.

Installing new Android studio Beta v.0.8.14

Hello I am new in Android development
So as suggested by google I downloaded the latest October 2014 beta version of Android Studio to start developing because they will end up solely with the Android Studio IDE so I thing it is a good idea to get used of it...
To install they just give you a zip file. I unzipped it and followed the text instructions which were simple BUT I cannot find the files and folders the say should exist in their unzipped folder/files :s .
The instructions are
'' To set up Android Studio on Windows:
Unzip the file, android-studio-ide--windows.zip and launch the studio.exe file.
Follow the setup wizard to install Android Studio and the SDK Tools.
On some Windows systems, the launcher script does not find where Java is installed. If you encounter this problem, you need to set an environment variable indicating the correct location.
Select Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.7.0_21. ''
Although I find the studio.exe at the path \android-studio-ide-135.1538390-windows\android-studio\bin
I cannot find any kind of a setup wizard for the SDK Tools!!
When I start the studio.exe program and I go to Configure/Project Defaults/Project Structure
the java sdk has been found but the android sdk folder naturally it is not.
And also the Configure/SDK Manager is not enabled.
What obvious thing am I missing here??
Thanks
If you downloaded android-studio-ide-135.1538390-windows, then it only contains the IDE and not the Android SDK. You need to download it separately:
http://dl.google.com/android/installer_r23.0.2-windows.exe
link
You will then point Android Studio to your SDK installation location.

Android Studio Error: "You must install the Android Support Repository though the SDK Manager"

I just initialised a project on Android Studio, and it was working fine in version 0.2.6, but in 0.2.7, I get this error:
It creates a folder inside my Applications directory, but it does not initialize the project. Any help regarding this problem would be appreciated. I get no problems with version 0.1.1 through version 0.2.6, but when it comes to 0.2.7, things start to get problematic, like this and I can't even start a project.
With 2.7 update I got the same issue. It looks like now Android Studio thinks sdk lays in under its own folder at android-studio/sdk.
You should be able to use android app under android-studio/sdk/tools to get missing components (not tested).
Another solution would be to fix sdk path (tested):
Close any projects then drop to Welcome to Android Studio Dialog
Select Configure -> Project Defaults -> Project Structure
Select SDKs -> Android SDK -> Android SDK Home Path
Update it to your previous sdk location.
got the same problem when applying the last patch (2.7). I've resolved it by copying SDK Manager.exe from android-studio\sdk\tools\lib to android-studio\sdk\ then I've launched it and install the missing component.
After restarting Android Studio it works again !
You must manually run SDK Manager.
Folder: android-studio/sdk/tools
Search for android or android-sdk
The new Support Repository must be already selected, and you need only click the "Install" button.
Just as Leonidos said, install ASR through SDK Manager:
Tools > Android > SDK Manager ; Navigate to the Extras folder, and select Android Support Repositories.
Click install packages and it will work fine
I did a fresh install of Java, SDK and Android Studio, update it to 0.2.7 and install the ASR through SDK Manager, but the messages comes again.
So i found this solution.
The most common problem for Android Studio and 64Bit Windows System is the no 8.3 short path for
C:\Program Files and C:\Program Files (x86).
find_java.exe
couldn't handle it and give a wrong path back.
Finally do this:
dir /x C:
-- It shows no 8.3 short paths.
fsutil 8dot3name query C:
-- It shows NtfsDisable8dot3NameCreation is 1 on "C:",
means 8.3 short path won't be created in "C:".
Then I enable the generation of 8.3 short name by:
fsutil 8dot3name set C: 0
and create short names for C:\Program Files and C:\Program Files (x86) in windows recovery mode by:
fsutil file setshortname "C:\Program Files" PROGRA~1
fsutil file setshortname "C:\Program Files (x86)" PROGRA~2
And now dir /x C: can show the short names.
And now find_java.exe -s
can show the short path C:\PROGRA~1\Java\JDK17~1.0_2\bin\java.exe.
And now find_java.bat and android.bat can work good now!
source
Also copying SDK Manager.exe from android-studio\sdk\tools\lib to android-studio\sdk\
Just a few ideas to try that should hopefully help. These can be found by using Ctrl + Shift + A.
"Sync project with Gradle" - (it's also often in the toolbar with a green and yellow ball and a blue down arrow next to three android icons)
"Gradle" and select the ToolBox option; then hit the blue refresh icon to refresh all the gradle projects
"Project Structure..." (also available under File) Under the Libraries project settings you should see a valid reference to your support library. You'll also want to skim through everything to make sure everything else looks good with the project.
"Invalidate Caches..." (another available under File) Invalidate and restart. This one got me going again after the previous upgrade generated a bunch of errors.
Some of these may be redundant, but after having fought with similar issues in the past it's just a few easy things I've found to check.
If refreshing everything doesn't work you can always pull up the Android SDK from Tools -> Android -> SDK or from the toolbar with the blue/green boxy android that has a black down arrow. It should be next to the Sync Gradle button.
I update the Android Studio(AS) and see the same issue.
However, there is something slightly different about what I find out.
I actually have two sdks because I shift from Eclipse to AS.
Hence, I get one sdk in
c:\Program Files(x86)\Android\android-sdk
and anther in
c:\Android\android-studio\sdk.
And the real one that I use is in c:\Program Files(x86)\Android\android-sdk.
The important thing is that, I find that only one of the sdk setting is changed after the update.
Quick Start > Configure > Project Defaults > Project Structure
> Platform Settings > SDKs
1.7
JDK home path:
C:\Program Files\Java\jdk1.7.0_10
Android 2.2 Platform
Android SDK home path:
C:\Program Files(x86)\Android\android-sdk
Android 4.0.3 Platform
same as 2.2
Android 4.2.2 Platform
Android SDK home path:
C:\Android\android-studio\sdk <- it is modified after update!!!!
Android 4.3 Platform
same as 2.2
After fixing the path in 4.2.2, I could create new project successfully again.
For some reason, if you install Android Studio in the same directory as the SDK, this error will pop up. Just install it somewhere else.
For instance, I had it installed at C:\Android\, along with the SDK. Then, I decided to install it at C:\Program Files (x86)\Android Studio and it simply worked.

what is the procedure for generating R.java in android Eclipse juno

I have installed eclipse juno and also added the plugin's of the android sdk. After installing android SDK manager, I've created a new android project, but a problem arises in R.java file. R.java doesn't open. Please give me a solution. I am new to android.
Click on Project -> Build Project
Edit
Remove your gen directory and bin directory
Click on Project -> Clean (wait till cleaning complete)
Click Project -> Build Project
Make sure you have Android SDK Build-Tools installed from the Android SDK Manager
Click this guy:
Then make sure the top three are all installed:
Ensure the code, resources and AndroidManifest.xml do not have any problem.
First, delete the R.java file. As soon as you delete, that file should be re-generated automatically if you have enabled automatic build (Project->Build Automatically).
If that doesn't work try to clean the project by clicking on Project->Clean.
If it still doesn't work then, confirm you have android sdk build tools installed. For this, open Android SDK Manager and ensure Android SDK Build-tools has the status of Installed.
Also confirm that the ADT is up-to-date. To update ADT, in eclipse go to:
Help -> Check for updates. Select the necessary entries like: Android Development Tools and update them.
Hopefully one of these solutions will solve your problems :-).

Categories

Resources