GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Error:Execution failed for task ':app:generateDebugProto'. · Issue #280 · GoogleCloudPlatform/java-docs-samples

Error:Execution failed for task ':app:generateDebugProto'. #280

New issue
Copy link
New issue
Copy link
Closed
Closed
Error:Execution failed for task ':app:generateDebugProto'.#280
Copy link
Labels
🚨This issue needs some love.triage meI really want to be triaged.

Description

@qingdaofu1
qingdaofu1
opened on Jul 29, 2016
Issue body actions

i test the google cloud speech api in android studio. after i set the gradle,protobuf, and i compiling the project ,i got the problem like blow:

Error:Execution failed for task ':app:generateDebugProto'.

protoc: stdout: . stderr: D:\Android\A1\GoogleSpeech\app\build\extracted-protos\main: warning: directory does not exist.
D:\Android\A1\GoogleSpeech\app\src\debug\proto: warning: directory does not exist.
D:\Android\A1\GoogleSpeech\app\build\extracted-protos\debug: warning: directory does not exist.
D:\Android\A1\GoogleSpeech\app\build\extracted-include-protos\debug: warning: directory does not exist.
D:\Android\A1\GoogleSpeech\app\src\debug\proto: warning: directory does not exist.
D:\Android\A1\GoogleSpeech\app\build\extracted-protos\debug: warning: directory does not exist.
D:\Android\A1\GoogleSpeech\app\build\extracted-include-protos\debug: warning: directory does not exist.
[libprotobuf WARNING google/protobuf/descriptor.cc:6117] Warning: Unused import: "google/logging/v2/logging.proto" imports "google/rpc/status.proto" which is not used.
[libprotobuf WARNING google/protobuf/descriptor.cc:6117] Warning: Unused import: "google/logging/v2/logging_config.proto" imports "google/protobuf/timestamp.proto" which is not used.
--java_out: google/api/annotations.proto: Unknown generator option: lite

Reacted by Igor Ganapolsky

Activity

  1. qingdaofu1 commented on Jul 29, 2016

    @qingdaofu1
    qingdaofu1
    on Jul 29, 2016
    Author
    More actions

    the app build.gradle is
    apply plugin: 'com.android.application'
    apply plugin: 'com.google.protobuf'

    android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"
    defaultConfig {
    applicationId "com.amrobotics.googlespeech"
    minSdkVersion 15
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
    }
    sourceSets {
    main {
    proto {
    srcDir 'src/main/proto/google/api'
    srcDir 'src/main/proto/google/logging'
    srcDir 'src/main/proto/google/longrunning'
    srcDir 'src/main/proto/google/rpc'
    srcDir 'src/main/proto/google/speech'
    srcDir 'src/main/proto/google/type'
    }
    java {
    srcDir 'src/main/java'
    }
    }
    }
    buildTypes {
    release {
    minifyEnabled true
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    }
    // compileOptions {
    // sourceCompatibility = JavaVersion.VERSION_1_7
    // targetCompatibility = JavaVersion.VERSION_1_7
    // }

    // https://github.com/square/okio/issues/58
    lintOptions {
        disable 'InvalidPackage', 'HardcodedText'
        textReport true
        textOutput "stdout"
    }
    

    }

    protobuf {
    protoc {
    artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
    }
    plugins {
    grpc {
    artifact = 'io.grpc:protoc-gen-grpc-java:0.15.0'
    }
    }
    generateProtoTasks {
    all().each { task ->
    task.builtins {
    // Javanano is installed by default, but needs to be removed to use protobuf lite..
    remove javanano
    java {
    // Options added to --java_out
    option 'lite'
    }
    }

            task.plugins {
                grpc {
                    // Options added to --grpc_out
                    option 'lite'
                }
            }
        }
    }
    

    }

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'javax.annotation:javax.annotation-api:1.2'
    compile 'com.android.support:appcompat-v7:24.1.0'
    compile 'io.grpc:grpc-netty:0.15.0'
    compile 'io.grpc:grpc-protobuf:0.15.0'
    compile 'io.grpc:grpc-stub:0.15.0'
    compile files('libs/grpc-grpclb-0.14.0.jar')
    compile files('libs/grpc-protobuf-nano-0.14.0.jar')
    compile files('libs/grpc-benchmarks-0.14.0.jar')
    compile files('libs/grpc-interop-testing-0.14.0.jar')
    compile files('libs/grpc-examples-0.14.0.jar')
    compile files('libs/commons-cli-2.0.jar')
    compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2'
    compile 'com.google.guava:guava:19.0'
    //compile files('libs/commons-cli-1.2.jar')
    compile files('libs/google-oauth-client-1.21.0.jar')
    compile files('libs/commons-cli-1.3.1.jar')
    }

    the project build.gradle is

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
    repositories {
    jcenter()
    // mavenCentral()
    // maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
    classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.7'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    }
    }

    allprojects {
    repositories {
    jcenter()
    mavenCentral()
    }
    }

    task clean(type: Delete) {
    delete rootProject.buildDir
    }

  2. puneith
    added
    SPEECH
    on Jul 29, 2016
  3. puneith commented on Jul 29, 2016

    @puneith
    puneith
    on Jul 29, 2016
    Contributor
    More actions

    @jerjou Any ideas here?

  4. lesv commented on Aug 9, 2016

    @lesv
    lesv
    on Aug 9, 2016
    Contributor
    More actions

    It looks like gradle is trying to compile before it runs the proto compiler. I suspect it's more complex than this, but my first guess would be to reverse the two plugins at the top of the file:

    apply plugin: 'com.google.protobuf'
    apply plugin: 'com.android.application'
    
    Reacted by Igor Ganapolsky, Ramankit Singh, RAMA KRISHNA AYINUMPUDI and Hu JiaJun
  5. puneith commented on Sep 7, 2016

    @puneith
    puneith
    on Sep 7, 2016
    Contributor
    More actions

    @qingdaofu1 Were you able to try above recommendations?

  6. ricmalta commented on Sep 19, 2016

    @ricmalta
    ricmalta
    on Sep 19, 2016
    More actions

    @qingdaofu1 have a look to an implementation I did for a simple demo.
    I had some problems with the gradle configuration, mainly with a dependency on a legacy version of guava.
    Its not bullet proof, but I'm get it working with android
    https://github.com/Cloudoki/android-google-cloud-speech-api

  7. puneith commented on Sep 19, 2016

    @puneith
    puneith
    on Sep 19, 2016
    Contributor
    More actions

    Thanks @ricmalta. @qingdaofu1 Can you also take a look at our Android samples which are up now https://github.com/GoogleCloudPlatform/android-docs-samples/tree/master/speech/Speech

    Reacted by Ricardo Malta
  8. puneith commented on Sep 28, 2016

    @puneith
    puneith
    on Sep 28, 2016
    Contributor
    More actions

    @ricmalta Closing this issue since the link worked for you.

  9. puneith
    closed this as completedon Sep 28, 2016
  10. IgorGanapolsky commented on Jan 5, 2017

    @IgorGanapolsky
    IgorGanapolsky
    on Jan 5, 2017
    More actions

    The solution is to place the following into your build.gradle file:

    protobuf { protoc { artifact = "com.google.protobuf:protoc:3.0.0" } plugins { lite { artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0" } } generateProtoTasks { all().each { task -> task.builtins { remove java } task.plugins { lite { } } } } }

  11. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨This issue needs some love.
    on Apr 6, 2020
  12. Shabirmean
    added 3 commits that reference this issue on Nov 17, 2022

    chore(deps): update dependency com.google.cloud:libraries-bom to v10 (#…

    5bdb9b4

    chore(deps): update dependency com.google.cloud:libraries-bom to v10 (#…

    1172de4

    chore(deps): update dependency com.google.cloud:libraries-bom to v10 (#…

    bddffde
  13. anguillanneuf
    added a commit that references this issue on Dec 5, 2022

    chore(deps): update dependency com.google.cloud:libraries-bom to v10 (#…

    a5201b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚨This issue needs some love.triage meI really want to be triaged.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.