簡體   English   中英

Android Studio 0.2.9無法創建新項目

[英]Android Studio 0.2.9 unable to create new project

更新到最新的0.2.9版本后,我無法在Android Studio中創建新項目。 我正在使用OSX並收到以下錯誤消息:“ 3字節UTF-8序列的無效字節2。”

檢查日志后,我看到以下內容:

2013-09-17 13:38:29,891 [ 110887]   WARN - .project.GradleProjectImporter - com.intellij.openapi.externalSystem.model.ExternalSystemException: Invalid byte 2 of 3-byte UTF-8 sequence.
    at com.android.tools.idea.gradle.project.ProjectImportErrorHandler.createUserFriendlyError(ProjectImportErrorHandler.java:204)
    at com.android.tools.idea.gradle.project.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:144)
    at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver$1.fun(AndroidGradleProjectResolver.java:136)
    at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver$1.fun(AndroidGradleProjectResolver.java:126)
    at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:161)
    at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.resolveProjectInfo(AndroidGradleProjectResolver.java:126)
    at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.resolveProjectInfo(AndroidGradleProjectResolver.java:76)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:87)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:44)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:53)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:130)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:120)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:407)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$1.run(ExternalSystemUtil.java:454)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:468)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:279)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:207)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:675)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:434)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:680)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:151)

我對較舊的項目也有同樣的問題。 有人有這個問題嗎? 我應該如何解決? 我發現問題出在Gradle上,但不幸的是,我不是實踐的Gradle用戶:/

編輯:我也看到此:

Gradle 'TodoNotesAppProject' project refresh failed:
         Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.7-bin.zip'.
         A problem occurred configuring project ':TodoNotesApp'.
         A problem occurred configuring project ':TodoNotesApp'.
         Could not resolve all dependencies for configuration ':TodoNotesApp:classpath'.
         Could not resolve org.ow2.asm:asm-analysis:4.0.
         Required by:
         TodoNotesAppProject:TodoNotesApp:unspecified > com.android.tools.build:gradle:0.5.7 > com.android.tools.lint:lint:22.2.0 > com.android.tools.lint:lint-checks:22.2.0
         com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
         Invalid byte 2 of 3-byte UTF-8 sequence

EDIT2(build.gradle文件):

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.5.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 18
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 16
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:18.0.0'
    compile 'com.android.support:gridlayout-v7:18.0.0'
    compile 'com.android.support:support-v4:18.0.0'
}

我從Tor Norbye得到了有關G +​​的答案。 如果我改變

classpath 'com.android.tools.build:gradle:0.5.+'

build.gradle中的行

classpath 'com.android.tools.build:gradle:0.5.6'

它是一個臨時解決方案。

答案如下:

“我不是Maven / Gradle專家,但聽起來您的存儲庫中有一些損壞的二進制文件?無論如何,這種依賴性使您看起來好像正在使用新版本的Android插件(0.5.7)。也許嘗試使用0.5.6(通過在build.gradle中而不是0.5。+中指定)作為臨時解決方法(不是永久性解決方案,因為0.5.7中還有其他重要的修復程序,因此我們需要弄清楚排除真正的問題。)”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM