I'm having a problem with starting an AVD from Eclipse.
When I start the AVD that I just created, it gives me the following error:
I think that is because of the username in the path...
I tried to just copy the .android to C:\ (=C:\.android) but the manager is just searching in the old path...
I tried to setup a environement variable like this:
Name: ANDROID_SDK_HOME
Value: C:\Users\André Peixoto\.android\.android
But it didn't solve the problem...
What should I try next?
UPDATE
I reinstalled the android sdk and now it doesn't show the weird characters:
But the path for the AVD_2_3_3.ini file still wrong. I think it should be: C:\Users\André Peixoto\.android\avd\AVD_2_3_3.ini instead of C:\Users\André Peixoto\.android\.android\.android/avd/AVD_2_3_3.ini
How should I change that?
I solved that using the solution presented on the comment 26 from here:
No matter your configuration. If the message will be like this
"[2011-11-21 22:31:24 - Emulator] PANIC: Could not open AVD config file: C:\Users\Ярослав.android\avd\my_defult_android_2_3_3_avd.avd/config.ini"
(
"C:\Users\Ярослав.android\avd\my_defult_android_2_3_3_avd.avd"
- it's your AVD device configuration. )
than :
copy direcoty "my_defult_android_2_3_3_avd.avd" to some place where the path will not contain "Ярослав" symbols (I in result had
the path like this
"d:\android\my_avd_devices\avd\my_defult_android_2_3_3_avd.avd").
File "my_defult_android_2_3_3_avd.ini" will contained in directory "C:\Users\Ярослав.android\avd\". Open this file.
Change "path=C:\Users\Ярослав.android\avd\my_defult_android_2_3_3_avd.avd" to
"path=d:\android\my_avd_devices\avd\my_defult_android_2_3_3_avd.avd"
Save and close. Start your application again))).
But at the first time I tried this solution and it didn't work. So I uninstalled the android SDK and eclipse and reinstalled all over again. I also removed the environments variables for android_sdk that I had previously set and set a new one called ANDROID_HOME with value C:\android-sdk.
Now I'm able to run AVD.
I think this is not a ideal solution because each time I create an AVD, I need to do this process. But for now it solves my problem.
Hope this solution helps someone else.
UPDATE - New Solution
I was having some problems with the previous solution so I used a diferent approach:
I created a new account (Administrator) in my Windows which the username havn't accents.
I put my Eclipse folder inside C:\ to have access from the new account.
Now, when I want to work with Android, I change to this new account.
Related
When I try to export the game build for the Android platform, I started getting this error:
Within the Project Settings - Minimum API Level and Target API Level not get loaded anyhow!
While I have used all default Unity provided settings to export Android build.
Here is the image to illustrate this:
Now what to do to solve this error?
I have already read all the threads related to same problem but overall I can't able to find the solution that actually worked for me.
Project Settings > Player > Target API Level: Change "Automatic" to "Android 11" (or else)
Play once and Stop.
Change target api level to Automatic.
I don't know if the problem is the same, but this is how I handle it every time.
Edit: Now I just do this; I open the Other Settings Tab in Player Settings. Error appears in console. I Play and Stop it once and the error goes away (No need to change API Levels)
I just got the same error on MacOS using both Unity 2019.4.18.f1/2019.2.21.f1 and after a lot of messing around I think I might have figured some of it out.
At times ( don't know why ) Unity ( or something else ) starts resetting the JAVA_HOME environment variable to string empty when you start Unity. So even if you set JAVA_HOME via console or .bashrc/.zshrc depending on MacOS version it still doesn't work.
Some posts mentioned adding "/" to the end of the external tools SDK path. I think that just forces Unity to set the path again which makes it work for a while. But for me the the error just came back the second day.
I permanently fixed it adding an editor script to the Editor folder that changes the JAVA_HOME environment variable every time Unity starts/loads.
Here's the method for MacOS, just paste it in a C# script in the editor folder.
[InitializeOnLoadMethod]
static void SetJavaHome()
{
//Debug.Log(EditorApplication.applicationPath);
Debug.Log("JAVA_HOME in editor was: " + Environment.GetEnvironmentVariable("JAVA_HOME"));
string newJDKPath = EditorApplication.applicationPath.Replace("Unity.app", "PlaybackEngines/AndroidPlayer/OpenJDK");
if (Environment.GetEnvironmentVariable("JAVA_HOME") != newJDKPath)
{
Environment.SetEnvironmentVariable("JAVA_HOME", newJDKPath);
}
Debug.Log("JAVA_HOME in editor set to: " + Environment.GetEnvironmentVariable("JAVA_HOME"));
}
This worked for me :- Edit>Prefrences>In JDK Click copy path> then Uncheck JDK and Paste the copied path again in that and after OpenJDK add \
like this : Before : C:\Program Files\Unity\Hub\Editor\2020.1.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
After : C:\Program Files\Unity\Hub\Editor\2020.1.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\
If that doesn't works than uncheck JDK,SDK,NDK,Gradle and Stop Gradle (all five boxes) than close unity. Open Again and Check all five boxes again.
I don't know why, but on mac os unity may use latest version of java if you have one.
If you have installed a few versions of java, you can just remove all except java v1.8.
You can check which version of java you have by typing in terminal /usr/libexec/java_home -V.
You should have 2 or more versions.
If you installed them with brew, you can just use brew to uninstall extra java packages.
Also you can update JAVA_HOME system variable by type
echo export "JAVA_HOME=$(/usr/libexec/java_home -v 1.8)" >> ~/.zshrc.
This solution worked for me.
I have such exaption
InvalidPathException: Illegal char at index 9: C:\Users\??????\.android\avd\1.avd (show balloon)
when trying to create emulator. Can I change the location of directory .android?
Open control panel
Then go to System
Then go to Change Environment Variables of the User
Then click create a new environment variables
Create a new variable named ANDROID_SDK_HOME
Set its value to your Android directory, like
C:/users/<username>/.android
I tried suggested solution but did not work for me.
In my case I have to add a different variable so steps for me were:
Open Control Panel
Then go to System and Security
Then go to System
Then go to Advanced system settings
Then go to Change Environment Variables of the User
Then click create a new environment variables
Create a new variable named ANDROID_AVD_HOME
Set its value to your Android directory, like C:/users/<username>/.android
How can I change the path to android\avd in my Android Studio ?
Let say you want to move avd directory from it's default C:\users\<username>\.android\avd to D:\Development\avd
Move avd directory to desired location (ex. D:\Development\avd)
Change or add environment variable ANDROID_AVD_HOME : D:\Development\avd
On Windows: Control Panel > System > Advanced system settings > Environment Variables
If variable doesn't exits Click New... and fill with aforementioned data.
If variable exists then select variable, click on Edit... and replace variable value with the new path (ex. D:\Development\avd)
If you have already AVD, change avdName.ini to D:\Development\avd\avdName (ex. D:\Development\avd\Nexus_S_API_22.avd)
There is a simple way to move avd(in windows):
open the directory: C:\Users\Username\.android\avd, you will find the directory named with your AVD and a .ini file
move the directory to your desirable path, then change the path variable in the .ini file to the new location.
start the Android studio, you will find that the AVD can work properly.
Just move the emulator folder(folder that ends with .avd) to new location and keep the .ini file in same location then change the path to new location in .ini file.
No environment variable needed to be changed or added.
old path
path=C:\Users\nero\.android\avd\Android_Q.avd
new path
path=D:\androidemuators\avd\Android_Q.avd
You can keep your emulator anywhere just need to tell .ini config file where your emulator is located.
Simple with Image solution here, no need to edit Environment Variables here.
Go to C:\Users\<PCname>\.android and move the avd folder to
your desired location. Example D:\Programming\Android Studio\avd
Open avd folder and edit every .ini files, each one of these is represent to your emulator.
Edit file location. See image below for your reference.
Restart your Android Studio.
These are .ini files:
Old path:
New path:
Had the same problem. The reason was that ANDROID_AVD_HOME pointed to my user directory which had a space and umlaut in it. Obviously that causes some trouble with Android Studio.
So defining a system wide ANDROID_AVD_HOME point to d:\development\avd\ solved the problem.
invalid command-line parameter: ..\Documents\android-sdk-windows\tools/emulator-arm.exe.
Any idea how can I solve that problem?
The only problem here is : you have to remove 1 extra space from the Eclipse path where you have declared your Android SDK from your local path.
This u can verify by following steps :
1. Eclipse->Windows->Preferences->Select Android option from left column.
2. See the path : in my case its : D:\Andriod SDK\android-sdk-windows
3. If u observe, there is a space in Android & SDK.
4. Close eclipse and go to the actual D location.
5. Change the name of the Android SDK folder to AndroidSDK. (Just remove the space in betn).
6. Restart the eclipse again and define the new path.
BINGO... Your emulator will run without any problem.
Thanks
Saurabh M. Chande
I'm trying to use Ensime to work with adnroid project generated with g8 (https://github.com/philcali/android-plugin). Followed this question I added the android.jar to my .ensime file. Here is it:
(:project-package "org.test"
:use-sbt t
:compile-jars ("~/_dev/_android/android-sdk-linux_x86/platforms/android-8/android.jar"))
Also i've got an exported ANDROID_SDK_HOME variable in my ~/.bashrc file.
But when i'm trying to start the ensime i'm getting this error:
java.lang.RuntimeException: Android SDK not found. You might need to set ANDROID_SDK_HOME or ANDROID_SDK_ROOT or ANDROID_HOME
at scala.Predef$.error(Predef.scala:58)
at AndroidPath$$anonfun$settings$8$$anonfun$apply$1.apply(AndroidPath.scala:21)
at AndroidPath$$anonfun$settings$8$$anonfun$apply$1.apply(AndroidPath.scala:21)
at scala.Option.getOrElse(Option.scala:104)
at AndroidPath$$anonfun$settings$8.apply(AndroidPath.scala:21)
at AndroidPath$$anonfun$settings$8.apply(AndroidPath.scala:20)
at sbt.Scoped$Apply$$anonfun$single$1.apply(Structure.scala:444)
at sbt.Scoped$Apply$$anonfun$single$1.apply(Structure.scala:444)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:44)
at sbt.Init$Apply.get(Settings.scala:223)
at sbt.Init$class.sbt$Init$$applySetting(Settings.scala:144)
at sbt.Init$$anonfun$compile$1$$anonfun$3$$anonfun$apply$2.apply(Settings.scala:100)
at sbt.Init$$anonfun$compile$1$$anonfun$3$$anonfun$apply$2.apply(Settings.scala:100)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123)
at scala.collection.immutable.List.foldLeft(List.scala:45)
at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139)
at scala.collection.immutable.List.$div$colon(List.scala:45)
at sbt.Init$$anonfun$compile$1$$anonfun$3.apply(Settings.scala:100)
at sbt.Init$$anonfun$compile$1$$anonfun$3.apply(Settings.scala:100)
at sbt.Init$$anonfun$sbt$Init$$applyInits$1.apply(Settings.scala:140)
at sbt.Init$$anonfun$sbt$Init$$applyInits$1.apply(Settings.scala:140)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123)
at scala.collection.immutable.List.foldLeft(List.scala:45)
at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139)
at scala.collection.immutable.List.$div$colon(List.scala:45)
at sbt.Init$class.sbt$Init$$applyInits(Settings.scala:140)
at sbt.Init$class.make(Settings.scala:92)
at sbt.Project$.make(Project.scala:102)
at sbt.Project$$anonfun$makeSettings$1.apply(Project.scala:177)
at sbt.Project$$anonfun$makeSettings$1.apply(Project.scala:177)
at sbt.Project$.translateCyclic(Project.scala:218)
at sbt.Project$.makeSettings(Project.scala:177)
at sbt.Load$.apply(Load.scala:120)
at sbt.Load$.defaultLoad(Load.scala:36)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:371)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:368)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:61)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:61)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:63)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:63)
at sbt.Command$.process(Command.scala:91)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:66)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:66)
at sbt.State$$anon$1.process(State.scala:59)
at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:66)
at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:66)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:13)
at sbt.MainLoop$.next(Main.scala:66)
at sbt.MainLoop$.run(Main.scala:61)
at sbt.xMain.run(Main.scala:33)
at xsbt.boot.Launch$.run(Launch.scala:54)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
at xsbt.boot.Launch$.launch(Launch.scala:68)
at xsbt.boot.Launch$.apply(Launch.scala:14)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
I couldn't understand the reason why it happens. Does anybody have some thoughts about it? Thanks.
The solution is found! The answer is here: https://github.com/aemoncannon/ensime/issues/184#issuecomment-2038002:
The environment variables in .bashrc are only valid for programs
running in or are started from bash, otherwise you'll need .profile.
If you're using emacs: You could use M-x getenv to see if emacs can
see the environment variable. Use a (setenv "ANDROID_SDK_HOME"
"~/_dev/_android/android-sdk-linux_x86/") in your .emacs to set it for
every emacs session. But you probably already know this so I don't
know if this is of any help at all. Emacs sometimes seems to be tricky
to set up concerning environment vars.
Thanks to zilti!
I'm trying to get PhoneGap working. I've hit a hurdle getting started.
I've downloaded version 0.9.1. I've been following the instructions at http://phonegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse
Using MacOS 10.5.8. Android SDK is already installed and working with Eclipse.
My .bash_profile file looks like this:-
$PATH=/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
export PATH=${PATH}:/Applications/android-sdk-mac_86/tools
export PATH=$PATH:/Applications/phonegap-android/bin
(and I restarted my terminal window to make it take effect)
I've tried the following command:-
cd /Applications/phonegap-android/bin
ruby ./droidgap /Applications/android-sdk-mac_86 HelloPhoneGap com.myidentity.android /Users/myidentity/Documents/workspace/HelloPhoneGap/assets/www /Users/myidentity/Desktop
...and I get the following error:-
./droidgap:4:in `require': no such file to load -- /Applications/phonegap-android/bin/lib/generate.rb (LoadError)
from ./droidgap:4
Why?
I ran into this issue as well, move droidgap up one level into the phonegap base directory.
Or, you should mention the complete path:
export PATH=$path: /Applications/phonegap-android/bin/**droidgap**
I came across such issues too. go to https://github.com/jonathanstark/phonegap-android, search the generate.rb file in the lib folder there, download it, then you are good to go.