I installed Android Studio the other day to develop an app and even though it's not the first time I've used it, it's the first time I've installed it on this PC and I'm fairly new to all of it.
Problem: After installing Android Studio, I can't even make a "Hello_World" app, even the templates AS offers have a compiling error:
Where it doesn't recognize symbols like "Override". The Alt+Enter solution that offers is to Setup JDK which does nothing for all options or create annotation 'Override' which doesn't really seem like a good option.
These are both build.gradle files:
Things I've tried to fix it:
Reinstall Android Studio Multiple Times
Download JDK manually and change references.
Check Enviromental Values on system (Add JAVA_HOME and heck Path to be correct). Pretty sure both java and JDK work since in cmd I can run java and javac.
Obviously Build->Clean and File->Invalidate Cache + Restart
android.enableAapt2=false on gradle.properties
Trying to delete all java from my PC and reinstall bare minimum THEN install everything separatedly.
Install all SDK plataforms until Android KitKat.
It's worth noticing that in the past I had a lot of problems getting java to run in only one place (mainly because I install software in an HDD and have OS on another SDD).
Also, while installing AS for the first time I got into a BSOD because of VT-x having shitty interaction with virtualization of anti-virus (that took me a while to figure out) so it stopped halfway. However I've reinstalled a bunch of times so I don't know how that could matter.
The problem is very similar to this one
I'm practically lost here. I've been trying to fix this for three days and I've looked into dozens of Stack-Overflow posts with similar problems, haven't found a solution.
Any idea will be appreciated.
Thanks.
I repeated your error:
I made it by deleting Android SDK(not java SDK) in Android Studio:
File-Settings-AndroidSDK
Try to pick at least one and install
It seems that your problem is related to Android SDK
Okay guys, I've finally figured it out, thanks to artmmslv.
Android Studio's installer detected automatically - two versions of Android SDK which were corrupted (probably caused by BSOD messing up the installation).
I had to make sure to delete everything. Java SDK, Android SDK. Java JRE. Every data from Appdata or documents from Android Studio. Once the computer is clean from any traces of already installed plugins, modules, and whatnot, it should be able to set up perfectly fine paths.
Also, make sure to set up manually and correctly the Environmental Values of java (path edit and JAVA_HOME).
Thanks for the help.
I got a solution that was a problem for me.
(in Build.Gradle file) - It's the
Compile SDK version 32
//which was not the latest one,
I changed it from older (31) in old projects to (32)
And clicked: sync now,
it worked!!
Hope it helps:) Happy coding
Related
Every time I try and build my game, I am unable to find the APK file anywhere, I did however found the APK file in my recent folder, but it doesn't show up in the respective folders I initially selected or allows me to copy and paste the APK file into my Android device.
I don't even get any errors when the game is built (in fact, I get a message in my console stating that my build was successful) so I am confused to why my APK file is not showing up.
It happened after I recently updated my unity 5.6 to unity 2018.3.1 due to Oracle JDK is no longer free for commercial use and unity 2018.3 uses OpenJDK (I am using AdoptOpenJDK/JDK-12.0.1.12-hotspot). Once unity was installed, I didn't receive any errors only a few warnings within a few scripts (which was only a minor problem and I could solve easily).
However, when I go to player settings, I get this one warning: "failed to get available Android API levels. Make sure your Android SDK tools version is 25 or higher and you have an internet connection."
I made sure that my minimum API level is Android 8.0 'Oreo' (API level 26) and the target API level is Android 8.1 'Oreo' (API level 27), I also uninstall Android studio and reinstalled.
I even went as far as deleting all folders inside build tools and platforms from (appdata>local>android>sdk>buildtools) & (appdata>local>android>sdk>platforms) and updating the files for continuing the build.
However, all the methods I've tried have not to work, so I'm asking for help here. Please, does anyone know why is my APK file not appearing at all? Thank you in advance, I really appreciate it! :)
this solution helped me if Are you using the r22 of android SDK, if so, Google decided to move the aapt.exe from tools directory to build-tools//aapt.exe
A quick solution for this is co copy the aapt.exe file from build-tools and paste as shortcut on tools directory. Keep the shortcut name as aapt.exe
another solution is to download jdk(1.8 version is prefered)from oracle site ["http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html"]and set it instead of the build-in jdk form the project preferences then reboot
I am trying to get Android Studio installed on Cent OS 6.5. I have downloaded and unzipped the package to /usr/share/applications/Android-studio/.
I have installed jdk 8 in /usr/share/applications/ (as I understand you just unpack it there, no need to compile or execute anything...?)
I have appended /etc/profile with "JAVA_HOME=/usr/share/applications/jdk1.8.0_1118"
When I execute the studio.sh file the app begins to run (I see some Java messages in the shell) then I get the error:
"JDK Required: 'tools.jar' seems to be not in Studio classpath.
Please ensure JAVA_HOME points to JDK rather than JRE".
I think this means something is wrong with my JDK files but I don't know what. I have followed multiple tutorials online about how to fix this error including the guides on Android studio and Oracle's websites and as far as I can tell I've done everything correctly, but I am still getting this error. What am I missing?
Thank you for your help.
After looking through some answers to similar questions (that didn't receive any votes so I had overlooked them previously) I solved the issue. I had to copy the 'tools.jar' file from /usr/share/applications/jdk1.8.0_1118/lib to /usr/share/applications/android-studio/lib. That did it. It is up and running. Apparently this file is missing from the package downloaded from the android studio website. I hope they fix that soon and save future users hassle.
I recently got a new machine and Windows 10, which I've never used. I'm going through the process of re-installing all of my app development software, which includes Git, Java 7, and Android Studio.
I was under the impression that everything installed fine, but I can't actually launch the IDE itself. The launcher is fine and I can go through the steps of creating a project, but whenever I click finish, the screen closes and nothing happens.
I wish I could give more details but that's really all that happens.
Any advice on how to troubleshoot this issue?
Some of my theories:
1) Android Studio doesn't seem to like spaces in path names and gives me warnings when creating projects and installing tools. That seems like a silly issue but it's not impossible I guess. It doesn't like "Program Files" or my username which is my full name, but Windows 10 by default names accounts "FirstName Lastname" and I can't seem to change the username to a string without a space.
2) Android Studio is not detecting Java (7). Perhaps it got the wrong location for the Java SDK since I installed them at the same time? Other people seem to have encountered a similar issue, but I would think that I at least get an error.
3) It's just some dumb tiny bug and I have to reinstall Android Studio.
Any help is appreciated, I want to get to work.
Java 7 is outdated. Download the java 8 JDK. http://www.oracle.com/technetwork/pt/java/javase/downloads/jdk8-downloads-2133151.html
Set your java path variables accordingly.Environment variables for java installation
Make sure you downloaded and installed the version of android studio
that included the SDK, if not download it separately. https://developer.android.com/studio/index.html#downloads
Set your path variables accordingly. Android Studio - How to Change Android SDK Path
Sorry if this is the wrong Stack Exchange, but this is where most of the questions were asked when I googled my problem.
For some time now I've been having problems with Android Studio and the AVD/SDK. It seems to be a relatively common problem, but I haven't been able to fix my problem with any of the solutions that worked for everyone else. This is the error I'm getting whenever I try and run the AVD or the SDK:
Cannot launch AVD manager.
Output:
Access is denied.
ERROR: No suitable Java found. In order to properly use the Android Developer
Tools, you need a suitable version of Java JDK installed on your system.
We recommend that you install the JDK version of JavaSE, available here:
http://www.oracle.com/technetwork/java/javase/downloads
If you already have Java installed, you can define the JAVA_HOME environment
variable in Control Panel / System / Avanced System Settings to point to the
JDK folder.
You can find the complete Android SDK requirements here:
http://developer.android.com/sdk/requirements.html
I've tried re-installing everything Java (Both JRE and JDK), reinstalling Android Studio, running as admin, configuring permissions and a bunch of other stuff. I'm running Windows 7 and I've tried both JDK/JRE 6, 7 and 8 (JDK 6 worked very poorly though). I don't really know what kind of information you need to help me solve this problem, but I'll supply any information needed as fast as I can. Thank you very much.
Edit:
Please note that Java IS installed. Both Java and Javac is working fine in cmd.
I can suggest that Go to Windows -> Preference -> Java -> Compiler
And try with different java version.
Probably your Java folders are in the path (and that's why they work from CMD) but your JAVA_HOME is not defined.
As you are on Windows try creating a System Variable following those steps
Try (re)installing the ADT and see if it works. If not, go to the sdk's root folder ([PATH TO THE UNZIPPED ADT]/sdk) and open the AVD Manager.exe. Does it still give you the same error? If not, try to open the SDK Manager.exe and make sure you've installed all the propper APIs. I'd recommend installing at least the SDK Tools and Platfom-tools, and all of API19 (Android 4.4.2).
Finally Solved my problem! Some software I had previously installed had created a Path in User Variables, which was the one I was using for my JDK path. I tried using the Path in System Variables and it worked just fine! Thanks to everyone who took time to help me.
I wanted to develop an android app a few months ago, so I followed all the steps from here-> https://developer.android.com/training/basics/firstapp/index.html?hl=p and I believe I downloaded all the tools I needed. I never got around to developing anything, so I tried starting again a few days ago. When I went to the above mentioned website, it said download the new versions of this and that, so I did. I tried following the steps, but now when I try to open eclipse, I get an error saying:
"Error could not find Java SE Runtime Environment".
My questions are:
How do I delete everything and start from scratch? I wan't to delete eclipse, sdk manager, sdk folder, everything. I want to follow the download instructions all over again and see what happens because it did seem to work the first time i tried a few months back.
Do I just delete some programs from control panel?
If this is not easy, how can I fix the error I'm getting when trying to open eclipse?
Edit: windows 7, 64-bit OS, if that helps
That sounds more like a problem of a corrupted Java installation. Check the JAVA_HOME environment variable. If this is empty fix this and try again.
To delete eclipse and the sdk just delete them from where you installed them.
SUGGESTIONS:
0) I assume you're running Windows. Please specify if you're on a different platform.
1) Delete Eclipse.
If you're not using Eclipse for anything else yet, I would strongly encourage you to delete it.
2) Uninstall your Java JDK (from Control Panel).
Download and install the JDK from Oracle: http://java.oracle.com.
3) Download and install the "ADT Bundle for Windows": https://developer.android.com/sdk/
In earlier versions of Android, you had to install Eclipse, the Android Plugins, and the Android SDK separately. I believe this is the procedure your link describes.
The newer "ADT Bundle" saves you this trouble. If Android is the only thing you're using Eclipse for (at least for now), you definitely want the ADT bundle. And you can probably ignore most of the instructions in your link.
'Hope that helps..