Problem with emulator in ANdroid - android

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

Related

Failed to update Android SDK Package List - Unity 2019.2.10f1

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.

android programming using Go mobile error import go.hello.Hello

I have question about error while importing import.hello.Hello in android studio, as you see in the picture below. please give me solution how to solve this error
See here #Arpit Patel answer You need to set the path like that
As you told you have 64 bit system then copy this path C:\Program Files\Java\jdk1.8.0_31
Step 1 :- Create JAVA_HOME variable by clicking new and past ( C:\Program Files\Java\jdk1.8.0_31) this path.
Step 2 Then click path variable and edit then past it your path after add semicolon (;) C:\Program Files\Java\jdk1.8.0_31
I am using windows 10 so this windows look like this
Note :- If above dialog not open then
, select path variable and click on Edit…. Locate the end of the current variable value
append the path of jdk, using a semicolon And click ok

Autocompletion not showing in Android Studio with dual screens

I just switched from Eclipse to Android Studio (IntelliJ).
I can't figure out how the autocompletion works! I tried Control + Space, Control + Shift + Space but i have no relevant suggestion. Not in the Java files, not in the layout files.
Is there another shortcut? Do I need to enable some option beforehand?
Preferences > Keymap > Code > Completion > Basic/SmartType:
It was actually a display problem. I'm using two screens, and the suggestions only appear when the IDE is on the main one.
The (imperfect) solution is to define the display where I'm using the IDE as the main one.
Just remove all the folder "AndroidStudioPreview";
On Windows:
Go to your User Folder - on Windows 7/8 this would be:
[SYSDRIVE]:\Users\[your username] (ex. C:\Users\JohnDoe\)
In this folder there should be a folder called .AndroidStudioPreview
On Mac OS X
Remove these files:
~/Library/Application Support/AndroidStudioPreview
~/Library/Caches/AndroidStudioPreview
~/Library/Logs/AndroidStudioPreview
~/Library/Preferences/AndroidStudioPreview
You can get your Autocompletion suggestions back in Android Studio by doing: File>Invalidate Coches/Restart...>Invalidate and Restart

How to add android tools dir to windows 7 path?

I like to quickly start hierarchyviewer. At the moment i use the prompt to go navigate to .... \AppData\local\android\android-sdk\tools\ and then hierarchyviewer
I think i need to add something to windows 7 path, but i don't know what to do exactly.
Any suggestions?
regards
Suppose you have download and install Android SDK, and extract it in some drive. There are two methods to set PATH:
Use command prompt :
set path=%path%;D:\android-sdk-windows\tools;
Another is follow these steps :
My Computer->Property->Advanced->Environment Variables->Edit Path Variable and add “D:\ android-sdk-windows\tools” into the Path Variables.
In your computer properties-advance-environment variables-system variable ,and you find variable "path", add your android/tools path in it.
The operate like add java.exe in you computer path
C:\Users\user\AppData\Local\Android\Sdk\tools\bin
and add it you your Path User variable

Android Virtual Device location error

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.

Categories

Resources