Android sdkmanager-许可证冻结,没有任何输出

时间:2019-05-16 19:44:10

标签: android docker android-sdk-tools

我有一个像这样的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 个答案:

答案 0 :(得分:0)

你这傻瓜!为什么将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