当前位置:  开发笔记 > 编程语言 > 正文

加载Android Studio时出现错误

如何解决《加载AndroidStudio时出现错误》经验,为你挑选了2个好方法。

我在Debian发行版上运行android studio(32位),每当我启动android studio时我都面临着gradle的问题,它会一直在加载,并且在gradle窗口中我会得到一长串错误,其中包含:

***Executing tasks: [:app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources]

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2421Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
AAPT err(Facade for 22453413): /home/user1/android-sdk-linux/build-tools/24.0.2/aapt: 1: /home/user1/android-sdk-linux/build-tools/24.0.2/aapt: Syntax error: Unterminated quoted string
AAPT err(Facade for 7072356): /home/user1/android-sdk-linux/build-tools/24.0.2/aapt: 1: /home/user1/android-sdk-linux/build-tools/24.0.2/aapt: Syntax error: Unterminated quoted string
AAPT err(Facade for 31338389): /home/user1/android-sdk-linux/build-tools/24.0.2/aapt: 1: /home/user1/android-sdk-linux/build-tools/24.0.2/aapt: Syntax error: Unterminated quoted string

Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands
Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands

AAPT err(Facade for 17737675): /home/user1/android-sdk-linux/build-tools/24.0.2/aapt: 1: /home/user1/android-sdk-linux/build-tools/24.0.2/aapt: Syntax error: Unterminated quoted string

Exception while processing task java.lang.RuntimeException: AAPT process not ready to receive commands

AAPT err(Facade for 11417836): /home/user1/android-sdk-linux/build-tools/24.0.2/aapt: 1: /home/user1/android-sdk-linux/build-tools/24.0.2/aapt: Syntax error: Unterminated quoted string
Thread(png-cruncher_5): Broken pipe
java.io.IOException: Broken pipe
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java:326)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
    at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
    at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
    at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
    at com.android.builder.png.QueuedCruncher$1.destruction(QueuedCruncher.java:144)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:245)
    at java.lang.Thread.run(Thread.java:745)
***

有重复此错误的页面和页面.我该怎么做才能解决这个问题?



1> DejaVu..:

通过将gradle降级到23.0.3来修复它.

http://dl.google.com/android/repository/build-tools_r23.0.3-linux.zip

下载它,并在它提取android-sdk/buildtools 替换buildToolsVersion为"23.0.3".

它奏效了.


对我来说有点微不足道的变化.我通过简单地将build.gradle(Module:app)中的buildToolsVersion替换为23.0.3升级到23.0.3,然后重新打开项目,让Android Studio在需要时立即自动下载并同步项目.

2> Aaron Mast..:

我正在运行Debian Stretch 64位试图运行React Native Android应用程序.我的修复是我必须运行以下命令,

sudo apt-get install zlib1g:i386

如果其他人在遇到与我相同的情况时遇到了这个问题,我认为这会给他们带来一些痛苦.

推荐阅读
手机用户2402852307
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有