开发者社区> 问答> 正文

google 原生 launcher3 Android studio 编译错误?报错

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 这个错误

展开
收起
爱吃鱼的程序员 2020-06-09 13:45:56 642 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    warning:directorydoesnotexist

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

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

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


    我是在终端用gradlewbuild的这个是出错的堆栈信息,但是目录不存在那个目录是编译生成的目录buildscript{
      repositories{
        mavenCentral()
      }
      dependencies{
        classpath'com.android.tools.build:gradle:1.3.0'
        classpath'com.google.protobuf:protobuf-gradle-plugin:0.7.0'
      }
    }
    applyplugin:'com.android.application'
    applyplugin:'com.google.protobuf'


    android{
      compileSdkVersion23
      buildToolsVersion"22.0.1"


      defaultConfig{
        applicationId"com.android.launcher3"
        minSdkVersion16
        targetSdkVersion23
        versionCode1
        versionName"1.0"
      }
      buildTypes{
        debug{
          minifyEnabledfalse
        }
      }
      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{
      //Configuretheprotocexecutable
      protoc{
        artifact='com.google.protobuf:protoc:3.0.0-alpha-3'
      }
    }


    这个是build.gradle文件

    注释掉这行

    backup.proto:21:8:Option"javanano_use_deprecated_package"unknown.

    楼主解决了吗?我也是这个问题

    2020-06-09 13:46:12
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
58同城Android客户端Walle框架演进与实践之路 立即下载
Android组件化实现 立即下载
蚂蚁聚宝Android秒级编译——Freeline 立即下载