3
回答
google 原生 launcher3 Android studio 编译错误
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

clone google 最新的launcher3 Android studio编译报错
Execution failed for task ':generateDebugProto'.

protoc: stdout: . stderr: F:\gitoschina\Launcher3\src\main\proto: warning: directory does not exist.
F:\gitoschina\Launcher3\build\extracted-protos\main: warning: directory does not exist.
F:\gitoschina\Launcher3\build\extracted-include-protos\main: warning: directory does not exist.
F:\gitoschina\Launcher3\src\debug\proto: warning: directory does not exist.
F:\gitoschina\Launcher3\build\extracted-protos\debug: warning: directory does not exist.
F:\gitoschina\Launcher3\build\extracted-include-protos\debug: warning: directory does not exist.
F:\gitoschina\Launcher3\src\debug\proto: warning: directory does not exist.
F:\gitoschina\Launcher3\build\extracted-protos\debug: warning: directory does not exist.
F:\gitoschina\Launcher3\build\extracted-include-protos\debug: warning: directory does not exist.
backup.proto:21:8: Option "javanano_use_deprecated_package" unknown.

at com.google.protobuf.gradle.GenerateProtoTask.compile(GenerateProtoTask.groovy:346)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
这个要怎么解决呢?
就是http://stackoverflow.com/questions/37934975/android-launcher3-build-fails 这个错误

举报
dzwillpower
发帖于1年前 3回/1K+阅
共有3个答案 最后回答: 1年前

warning: directory does not exist

应该是文件不存在,你可以区相关路径下查看是否存在。

 如果你在studio中build google的launcher应该需要一个framework的jar,不然你可能build不通过。

或者你可以直接使用gradle build下看看能否build 成功


--- 共有 1 条评论 ---
dzwillpower我是在终端 用 gradlew build 的 这个是出错的堆栈信息,但是目录不存在 那个目录是编译生成的目录 1年前 回复
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.0'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.protobuf'


android {
    compileSdkVersion 23
    buildToolsVersion "22.0.1"


    defaultConfig {
        applicationId "com.android.launcher3"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        debug {
            minifyEnabled false
        }
    }
    sourceSets {
        main {
            res.srcDirs = ['res', 'WallpaperPicker/res']
            main.java.srcDirs = ['src', 'WallpaperPicker/src']
            manifest.srcFile 'AndroidManifest.xml'
            proto.srcDirs 'protos/'
        }
    }
}


repositories {
    mavenCentral()
}


dependencies {
    compile 'com.android.support:support-v4:+'
    compile 'com.android.support:recyclerview-v7:+'
    compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2'
}


protobuf {
    // Configure the protoc executable
    protoc {
        artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
    }
}


这个是build.gradle文件
顶部