SDK manager path [duplicate] - unity3d

I am trying to build old unity version(v_4.6.3) project. but i have got a error. already i have got successful result, but current my sdk is updated with latest version.
http://screencast.com/t/u7lNiyoc
Here is my unity error log.
Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:\Program Files\Java\jdk1.8.0_66\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="E:/Temp/sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -
stderr[
Exception in thread "main" java.lang.NoClassDefFoundError: com/android/utils/ILogger
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at SDKMain.main(SDKMain.java:128)
Caused by: java.lang.ClassNotFoundException: com.android.utils.ILogger
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
]
stdout[
]
How can i fix this issues. Thank you for advances. Kind Regards.

The solution to this problem is constantly changing over time as Unity and the Android SDK change.
Note that his problem is presumably fixed in Unity 2017.1.
LATEST SOLUTION
1) For Windows, download "tools_r25.2.3-windows.zip" and unzip it.
2) For MacOSX, download "tools_r25.2.3-macosx.zip" and unzip it.
3) Add the path of the unzipped SDK to the Edit -->Preferences ---> External Tools --->SDK box.
STILL NOT WORKING?
Uninstall SDK Tools 25 and Android SDK Tools 26. Uninstall both SDK Platform-Tools and SDK Tools. Use version number below that.
OLD SOLUTION:
You did not setup your SDK properly.
Follow the steps below to setup your Android SDK.
1. Make sure that there are no spaces in your SDKpath. So create a folder called AndroidSDK in the C directory.
2. Copy your Android-sdk folder to the C:/AndroidSDK directory.
Now, your SDK path should look like this:
C:/AndroidSDK/Android-sdk
3. Update your Android SDK path in the Unity Editor.
Now, check if it works by trying to Build for Android again.
If it fails, continue from below
4. Download the latest Unity version.
5. Re-download SDK then copy the file to C:/AndroidSDK/Android-sdk.
6. Go back to Unity and Update the path
7. Build the Project for Android again, it will show an error and ask you to update SDK.
Click on the "Update Android SDK" buttom. Unity will Automatically update your SDK. Your SDK should then look like something below. Your problem should be gone by now.

Related

Unity 2022.1.20f1 Fresh Install - Missing NDK for Android

I have re-installed Unity 2022.1.20f1 after I did an update.
However, I can no longer compile and Android Project for the Quest 2.
It reports Android NDK not found or invalid. Please, fix it in Edit/Unit->Preferences->External Tools.
Here it tells me I am missing the Android NDK with a fixed path of
C:\Program Files\Unity\Hub\Editor\2022.1.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
And as you can see from the image below, There is no NDK folder.
I have re-installed it twice.
I installed another version of the Editor and the NDK folder does exist in it's respective location.
I have tried to use the NDK for the working Version but it reports anything other than 21.3.6528147 are not officially supported.
I am at my wits end and wondered if anybody else has had this issue?
Many thanks
Mark
Hello you need to install the android NDK separatly and then provide the new NDK folder path in the setting of Unity as well as the SDK of android folder path as well. You have 2 methodes to do so 1 : to just install install android studio with all the stuff I mentioned or 2: just install them one by one from the website NDK Installation
SDK Installation

Issue in setting up the Android emulator with React native

I am fairly new to React native and trying to set up Android environment with Visual studio. All the installation has been fairly successful, however, when I try to run the sample app on the android emulator executing the npx react-native run-android command it shows below error -
'C:\Users\Home' is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:109)
However, when i execute adb devices on visual studio, it shows the list of emulator connected -
List of devices attached
emulator-5554 device
What could be the possible reason? Is this because my users name is Home PC? (Is this because there is a space in between) and it is not able to get the correct path?
This is because your java version is updated to the latest version and gradle is not supported with the installed version. what you can do is update the gradle as well
So go to gradle/wrapper folder inside the android folder
Edit gradle-wrapper.properties file and replace distributionUrl
with following value
https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
I too faced the same issue.The problem is with the JDK. From JDK 14 i downgraded to JDK 11(LTS) version. And it worked.
Hope it helps.
Install Java 8 version, which is available Java 8 download
Gradle is not keeping up with the Java Latest versions, so roll back
to previous versions

(Unity android build error) Error building Player: CommandInvokationFailure: Unable to list target platforms issue [duplicate]

I am trying to build old unity version(v_4.6.3) project. but i have got a error. already i have got successful result, but current my sdk is updated with latest version.
http://screencast.com/t/u7lNiyoc
Here is my unity error log.
Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:\Program Files\Java\jdk1.8.0_66\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="E:/Temp/sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -
stderr[
Exception in thread "main" java.lang.NoClassDefFoundError: com/android/utils/ILogger
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at SDKMain.main(SDKMain.java:128)
Caused by: java.lang.ClassNotFoundException: com.android.utils.ILogger
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
]
stdout[
]
How can i fix this issues. Thank you for advances. Kind Regards.
The solution to this problem is constantly changing over time as Unity and the Android SDK change.
Note that his problem is presumably fixed in Unity 2017.1.
LATEST SOLUTION
1) For Windows, download "tools_r25.2.3-windows.zip" and unzip it.
2) For MacOSX, download "tools_r25.2.3-macosx.zip" and unzip it.
3) Add the path of the unzipped SDK to the Edit -->Preferences ---> External Tools --->SDK box.
STILL NOT WORKING?
Uninstall SDK Tools 25 and Android SDK Tools 26. Uninstall both SDK Platform-Tools and SDK Tools. Use version number below that.
OLD SOLUTION:
You did not setup your SDK properly.
Follow the steps below to setup your Android SDK.
1. Make sure that there are no spaces in your SDKpath. So create a folder called AndroidSDK in the C directory.
2. Copy your Android-sdk folder to the C:/AndroidSDK directory.
Now, your SDK path should look like this:
C:/AndroidSDK/Android-sdk
3. Update your Android SDK path in the Unity Editor.
Now, check if it works by trying to Build for Android again.
If it fails, continue from below
4. Download the latest Unity version.
5. Re-download SDK then copy the file to C:/AndroidSDK/Android-sdk.
6. Go back to Unity and Update the path
7. Build the Project for Android again, it will show an error and ask you to update SDK.
Click on the "Update Android SDK" buttom. Unity will Automatically update your SDK. Your SDK should then look like something below. Your problem should be gone by now.

Android studio:import NDK project from eclipse

I exported project from Eclipse(windows) and imported it to android studio V 0.4.2(ubuntu).
The project include working NDK library.
I get this error when try to run my app:
Execution failed for task ':app:compileDebugNdk'.
NDK not configured
From others stackoverflow posts, I understand that it is an issue.
But get no workaround for this.
Should i proceed the development with eclipse for now, or is that the a lazy option ?
EDIT :
I run this command:
export NDK=~/Downloads/android-ndk-r9c
and then :
and then go to my app directory and run this:
ndk-build
And i get this:
yarinkos-u#yarinkosu-MSI-Notebook-EX600:~/AndroidStudioProjects/AndEngineEXperimental$ ndk-build
/home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: 1: /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: dirname: not found
/home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: 132: /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: uname: not found
ERROR: Unknown host operating system:
What i did wrong?
It seems that the script running,but i miss something there.
EDIT 2:
i mistakenly runing this also :
export PATH=~/Downloads/android-ndk-r9c
so i get the error above.
If i running onlt this :
export NDK=~/Downloads/android-ndk-r9c
I get ndk-build not found error.
NDK Support is introduced from Android Studio 0.4.1 only, so make sure you are running AS 0.4.1 or above.
Android gradle plugin must be 0.7.+ in build.gradle file and also new NDK integration requires NDK r9c .
Lines from Developer tools blog under Release 0.4.1
Supports importing NDK projects. If the imported project contains NDK
sources, these are imported into the jni/ source set of the project,
the module name is inferred from the Makefile and stored in the Gradle
file, and the ndk.dir property is defined in local.properties.
Check more about it here :
http://tools.android.com/recent
you need to download the NDK for your operatings system # https://developer.android.com/tools/sdk/ndk/index.html once it's downloaded, install it it'll extract the contents to the correct file system it needs to be in it'll take some time, also make sure you are running the latest android studio. it worked for me. good luck.

Android SDK: How to set up old versions? eg. gingerbread

my goal here is to run an android emulator with various old versions of Android to test web apps. I am an android newbie. I have a Nexus 7 with Jellybean. The bugs on the web apps are reported in older versions.
So far I have;
Installed Android SDK on a Windows 8 desktop, created and run emulators but it's limited to Android 4.2 only (Jellybean)
I think the next step is to run the SDK Manager -- Ecplipse > Window > Android SDK Manager
Doing this reports that the Manager will show shortly -- nothing happens. In the console I get this error;
[2013-02-09 16:31:49 - SDK Manager] [SDK Manager] \adt-bundle-windows-x86_64\sdk\tools\lib\\find_java.exe was unexpected at this time.
Running find_java.exe from the command line gives:
D:\Program Files (x86)\adt-bundle-windows-x86_64>sdk\tools\lib\\find_java.exe
C:\Program Files\Java\jre7\bin\java.exe
D:\Program Files (x86)\adt-bundle-windows-x86_64>where java
C:\Program Files\Java\jre7\bin\java.exe
C:\Windows\System32\java.exe
I have updated the PATH environment var to include the jre7 directory as above, and added a ANDROID_SDK_HOME as D:\Users\myuser_000\Documents\Workspace -- devices I create appear in a .android\avd sub-directory.
I am running the SDK on Windows 8, installed in D:\Program Files (x86)\adt-bundle-windows-x86_64
Is running the SDK Manager the correct action?
Any ideas what would cause the SDK Manager not to display?
Thank you!
The error was in the android.bat file.
I edited the following to comment out the call to find_java.bat and hard coded to my installed version of Java.
rem Check we have a valid Java.exe in the path.
set java_exe="C:\Program Files\Java\jre7\bin\java"
rem call lib\find_java.bat
Hope this helps someone in the future.
Something that may have complicated the issue was windows 8 catching android.bat as an unsafe program and automatically stopping it. I saw this when manually trying to run the batch file.