Android sdkmanager --licenses 冻结而没有任何输出
Posted
技术标签:
【中文标题】Android sdkmanager --licenses 冻结而没有任何输出【英文标题】:Android sdkmanager --licenses freezes without any output 【发布时间】:2019-10-04 03:34:09 【问题描述】:我有一个像这样的 Dockerfile:
FROM debian:9
RUN apt-get update -y && \
apt-get install -y --no-install-recommends wget unzip openjdk-8-jdk
RUN wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -O sdk-tools-linux.zip
RUN unzip sdk-tools-linux.zip
当我跑的时候
docker run -it my-image /tools/bin/sdkmanager --licenses
它就在那里挂了一百万年。
后来我改变了一些东西,并开始收到这个奇怪的错误消息:
Exception in thread "main" java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /proc/self/task/1/cwd/etc/ssl/certs/T??RKTRUST_Elektronik_Sertifika_Hizmet_Sa??lay??c??s??_H5.pem
at sun.nio.fs.UnixPath.encode(UnixPath.java:147)
at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
at com.android.repository.io.impl.FileSystemFileOp.toPath(FileSystemFileOp.java:284)
at com.android.repository.io.impl.FileSystemFileOp.isDirectory(FileSystemFileOp.java:169)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.collectPackages(LocalRepoLoaderImpl.java:225)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.collectPackages(LocalRepoLoaderImpl.java:226)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.collectPackages(LocalRepoLoaderImpl.java:226)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.collectPackages(LocalRepoLoaderImpl.java:226)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.collectPackages(LocalRepoLoaderImpl.java:226)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.collectPackages(LocalRepoLoaderImpl.java:226)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.collectPackages(LocalRepoLoaderImpl.java:226)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.collectPackages(LocalRepoLoaderImpl.java:226)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.collectPackages(LocalRepoLoaderImpl.java:226)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.collectPackages(LocalRepoLoaderImpl.java:201)
at com.android.repository.impl.manager.LocalRepoLoaderImpl.getPackages(LocalRepoLoaderImpl.java:123)
at com.android.repository.impl.manager.RepoManagerImpl$LoadTask.run(RepoManagerImpl.java:518)
at com.android.repository.api.RepoManager$DummyProgressRunner.runSyncWithProgress(RepoManager.java:397)
at com.android.repository.impl.manager.RepoManagerImpl.load(RepoManagerImpl.java:365)
at com.android.repository.api.RepoManager.loadSynchronously(RepoManager.java:290)
at com.android.sdklib.repository.AndroidSdkHandler$RepoConfig.createRepoManager(AndroidSdkHandler.java:725)
at com.android.sdklib.repository.AndroidSdkHandler.getSdkManager(AndroidSdkHandler.java:296)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.setSdkHandler(SdkManagerCliSettings.java:101)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.<init>(SdkManagerCli.java:95)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:74)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
我感到很无助。
【问题讨论】:
【参考方案1】:你这个笨蛋!为什么要将 android sdk zip 解压缩到 docker 映像的根目录中?把它移到根目录外,一切都会好起来的!
FROM debian:9
RUN apt-get update -y && \
apt-get install -y --no-install-recommends wget unzip openjdk-8-jdk
RUN wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -O sdk-tools-linux.zip
RUN mkdir -p /sdk
RUN mv sdk-tools-linux.zip /sdk
RUN cd /sdk && unzip sdk-tools-linux.zip
docker build . -t my-image && docker run -it my-image sdk/tools/bin/sdkmanager --licenses
【讨论】:
以上是关于Android sdkmanager --licenses 冻结而没有任何输出的主要内容,如果未能解决你的问题,请参考以下文章
返回的工具/android 找不到 sdkmanager.jar
Android Studio 在没有 sdkmanager 的情况下安装
无法运行 Android SDK 管理器。如何运行 SDKmanager.bat?