Android Studio SDK path contains accents - java

I have a probelm when I'm starting a new Android project. I proceed without a problem to the last step, but when I press finish, this error appears:
Sync Android SDKs
The path
'C:\Users\Tom�\AppData\Local\Android\Sdk'
does not refer to an Android SDK.
Android Studio will use its default SDK instead:
'C:\Users\Tomáš\AppData\Local\Android\Sdk'
and will modify the project's local.properties file.
The problem is obviously caused by my user folder, which contains special characters ('á' and 'š'), because it's part of my name (I'm from the Czech Republic). Unfortunately, this folder cannot be renamed.
I have tried to change all the encodings setting to UTF-8, but it did not help at all.
I'll be grateful for every advice.

I can't help you with the localization problem, however I have had a similar issue and I hope that your problem can be resolved in a similar manor.
My advice would therefore be:
Create a new folder in your C:\ drive (name it something without special characters)
Copy and paste both your SDK and android studio to the new folder.
Enter the folder containing android studio and create a new shortcut to "studio64.exe" (for 64-bit. I think that is the right name, but I'm on my phone so I'm not sure)
I would also advice you to create another folder for your android studio projects by following step one above as the special characters may cause issues. (That was my original problem. Most things worked fine, but some were very strange indeed)

Related

New project in Android Studio does not show basic code and does not create java file

I'm new to Java coding and to Android studio. After selecting to create a new project, I select the option "Empty Activity" and then Java as the language. I essentially follow all the "newby" steps, as described, say, here in the first answer: Starting New Project in Android Studio
When I press finish, I get the following screen:
EDIT: The directory in which Android studio is installed is contained within a User folder that contains a space (it can't be renamed). This might be a source of problems (I don't know). I also tried saving the projects in folder C, not in a subfolder contained within C, but this solves nothing (Android Studio was not installed in said folder).
I've read that upon successfully creating such a new project, I should get a screen with some basic code on it. I get nothing like this. I also read that Android studio should create an xml file and a .java file. The .java file is missing.
What's going wrong here? Where can I start writing code? How can I fix this?
Its look like your project is not created properly, If you create new project in android studio it will look like as below SS.
You can also check your project folder and file from finder option like below SS.
After that you can see below structure for your project
You don't found anything like above SS please try to create another project but this time change your location for your project.
One more thing in Android Kotlin is more preferable over JAVA so also check with Kotlin for development.
Good Luck!!.

Android Studio Java (generated) files are posing errors while running the app

I just imported a project in my Android Studio. When I tried to refactor the package name, I started facing errors. I am a beginner in Android so just need your help.
When I refactored the package name by renaming the first folder after java. It did change the folder name but there were some imports in files of java (generated). Now I am unable to optimize imports in the generated files as it cannot be changed and all the changes are lost.
you are under java (generated) folder ...
those java files should not be edited...
those are generated by compiler....
it is clearly written above it should not be edited
as you said I am trying to refactor the package name just refer this this
Thanks
from Android Studio IDE file menu -> Invalidate Cache and restart -> Invalidate Cache and restart.
this should solve your errors
If you are planning to change the name of the package try this answer. what is the purpose to edit a generated file

Can't open file in java-eclipse neon

I am just starting off in Java and trying to follow buckythenewboston on you tube. I have java and eclipse neon both downloaded correctly. However, when I create a new project like he showed in the video, I click finish and nothing shows up, in the video it showed on the side there should be a like java symbol with the name of the project I created. Well nothing happens it is blank on my screen. I tried opening a file from the work space in my C drive and that doesn't work either as nothing shows up so I can create a class. I know there is a couple of forum questions with similar title but that is different I think as they can at least get code in where I can't. Any explanation as what is going on would be helpful. I also tried to go to file-import-existing project... but the existing project part isn't an option.
Thanks in advance.
go into your workspace directory and delete .metadata folder, then restart eclipse
Close all perspectives and open a new one, the one you like.

Can't get R.java back in eclipse

I have a massive problem, and I can't find a single thread out there that specifies this problem.
I'd been watching Google IO, and the Android Studio was mentioned, I downloaded it, installed it, and opened my project into there, as I wanted to try out some of the new features, Fine and dandy, (on a separate note, I love Android Studio)
It was working before in Eclipse, and I literally changed nothing about my project, I was only looking around at the device preview features and stuff, didn't touch any piece of code what so ever, just having a look at some of the features..
Went back to eclipse, and my generated folder only showed R in, no tree structure of R or anything, just R.java, and R inside it, and everything in my classes were underlined, but it wasn't the R that was, it was the value after it (ie. Cannot find R.layout.main) which I thought was really weird, so I cleaned my project, and it disappeared, I now have a project without a generated R.java file.
To note; I changed nothing about my project, all my XML files were absolutely fine, i've tried every trick I can find on StackOverFlow and other websites (removing some of the XML's, painstakingly going over my 15 layout files character by character for an hour, removing imports, build paths, etc) and nothing works, and i've been trying to do this for almost 3 hours now.. Does anyone have any experience doing this, or any solution?
in the Gen section of your project, try to delete the R.java
It should re-generate, I had some issues like that in the past..
Give it go.
The R file may not be generated due to errors in the project.
Check your xml files in res folder. Also read Error log of the eclipse.
(Windows -> Show View -> Problems)
The best way is copy R.java from another project and Past it in gen
And then Delete R.java file then the system will recreate R.java back for you..........

Android Eclipse Correct Export?

I'm using Eclipse-plugin to develop Android applications on mac.
I've got a project and I followed the steps in 'Android Tools > Export signed Application Package' successfully, but all I end up with is a blank-icon .apk.
Is it supposed to look like that? I've followed the instructions from what I can tell.
And when I transfer it to a phone, it won't execute. It's just reads "Can't use as a valid .apk-file". For the record, the application works just fine in the emulator.
Any help on this please?
did you check taht you have an icon file inside your drawables folder?
drawable
drawable-ldpi
drawable-mdpi
drawable-hdpi
should have it at least in drawable folder but chek every folder just in case the current icon defined un any of those folder is corrupted.
Seems like I've solved the problem... somehow. it just started working for some reason.
I guess the application was signed and zip aligned as aimed for after all.

Categories