任务“publishApkRelease”在根项目未找到 [英] Task 'publishApkRelease' not found in root project

查看:900
本文介绍了任务“publishApkRelease”在根项目未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着去配置 gradle这个播放出版商
 在的build.gradle在我的项目,我已经配置发挥块(模块:APP),这是我的build.gradle(模块:应用程序):

Im trying to configure gradle-play-publisher in my project, I have configured play block in build.gradle(Module: app), here's my build.gradle(Module:app):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc2"

    defaultConfig {
        applicationId "com.***.***"
        minSdkVersion 11
        targetSdkVersion 21

        ndk {
            moduleName "mupdf"
        }
    }

    signingConfigs {
        release {
            storeFile file("./***")
            storePassword "***"
            keyAlias "***"
            keyPassword "***"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            signingConfig signingConfigs.release
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }

    sourceSets.main {
        jniLibs.srcDir 'app/src/main/jniLibs'
        jni.srcDirs = []
    }

    lintOptions {
        abortOnError false
    }
}

apply plugin: 'com.github.triplet.play'
//apply plugin: 'play'

play {
    serviceAccountEmail = '***@developer.gserviceaccount.com'
    pk12File = file('./***.p12')
}

dependencies {
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services:+'
}

下面是我的build.gradle(项目)

Here's my build.gradle (Project)

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
        classpath 'com.github.triplet.gradle:play-publisher:1.1.1'
        classpath 'com.google.guava:guava:18.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

林上运行 ./ gradlew publishApkRelease --stacktrace 获得以下异常:

    * Exception is:
    org.gradle.execution.TaskSelectionException: Task 'publishApkRelease' not found in root project '***'.
        at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:101)
        at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:76)
        at 
...
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)

如何解决呢?

推荐答案

貌似任务不是在根项目中找到。您是否尝试过

Looks like the task is not found in the root project. Have you tried

./gradlew app:publishApkRelease

呢?

顺便说一句,您可以运行

Btw, you can run

./gradlew tasks

要看到所有可用的任务。

to see all the available tasks.

这篇关于任务“publishApkRelease”在根项目未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆