Closed NemoStein closed 6 years ago
I guess this would still have to go into the extras
bucket, since the Android SDK license is not open source.
Uhn, I think you're completely right! I thought the same a second after opening the issue...
Should this one be closed and reopened there?
I'm on it. Leave it open 😄
Thanks, @r15ch13. May I request another thing? Could it create a ANDROID_HOME env var pointing to the "bin" folder?
Oh, another thing that I noticed. After installing a build-tool, the sdkmanager puts everything in the same parent folder, mixing scoop generated folders with sdkmanager generated ones. I think that a better solution is to put the content of the downloaded zip inside a tools folder, keeping the same original folder structure.
This is one of my tests and it's output:
t1 $ cordova run android
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Detected 'avdmanager' command at C:\Users\Nemo\scoop\shims but no 'tools\bin' directory found near.
Try reinstall Android SDK or update your PATH to include valid path to SDK\tools\bin directory.
Yeah, I noticed the tools
directory thing. 😀
monitor.bat
will still not work because it needs stuff from platform-tools
... (which are included in adb.json)
Uhn, I haven't tried this one... I always thought that the Android SDK dependency is awkward. Anyway, is this "fixable"?
https://dl.google.com/android/repository/platform-tools-latest-windows.zip
will result in checksum problems if one gets updated~https://dl.google.com/android/repository/platform-tools_r26.0.2-windows.zip
will result in an outdated adb version~Should work with https://github.com/lukesampson/scoop-extras/commit/8e72ae8d0c3094defddb83b440f7d86210db5560
Creating a symlink to the adb\current
directory works across updates 😁
I don't know why, but the sdkmanager is looking for bin folder in the wrong place.
~ $ sdkmanager --update
& : O termo 'C:\Users\Nemo\scoop\shims\..\apps\android-sdk\current\bin\sdkmanager.bat' não é reconhecido como nome de
cmdlet, função, arquivo de script ou programa operável. Verifique a grafia do nome ou, se um caminho tiver sido
incluído, veja se o caminho está correto e tente novamente.
No C:\Users\Nemo\scoop\shims\sdkmanager.ps1:2 caractere:70
+ ... ion.expectingInput) { $input | & $path @args } else { & $path @args }
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\Nemo\s...\sdkmanager.bat:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The correct path is C:\Users\Nemo\scoop\shims\..\apps\android-sdk\current\tools\bin\sdkmanager.bat
(missing the tools
)
EDIT: Now I know why.
The first line of the sdkmanager.ps1
is the culprit.
The path is wrong there!
$path = join-path "$psscriptroot" "..\apps\android-sdk\current\bin\sdkmanager.bat"
should be
$path = join-path "$psscriptroot" "..\apps\android-sdk\current\tools\bin\sdkmanager.bat"
Added a fix for the env path. But there is another problem. It downloads the emulator to android-sdk\current\emulator
which will get moved on scoop update android-sdk
. Adding persistence doesn't work because sdkmanager
renames it to emulator.backup
(this removes the symlink)
Many many thanks, @r15ch13! I'll make some more tests in the following days/weeks, but for now, it's working as intended.
ps: The only issue I'm facing currently is the sdkmanager --update
locking the tools
folder and not being able to update itself, but it's a know issue in Windows version of the Android SDK.
+ CategoryInfo : ObjectNotFound: (android_sdk/platform-tools:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
how can solve this problem
It doesn't look related to Scoop. What are you trying to install?
Now that there is no GUI on Android SDK manager/tools anymore, isn't it ready to be included on scoop?
The official link is at the end of this link: https://developer.android.com/studio/index.html Current version can be downloaded directly from this link: https://dl.google.com/android/repository/sdk-tools-windows-3859397.zip