oliviergauthier / gradle-appcenter-plugin

This gradle plugin allow you to upload each build variant of your android application to separate AppCenter Apps.
MIT License
84 stars 44 forks source link

Could not locate plugin tasks #12

Closed maverickabhi1991 closed 5 years ago

maverickabhi1991 commented 5 years ago

There are two duplicate issues already in this repo and closed. No thread answers issue. Can you please add an example to use the tasks such as "appCenterUploadBetaRelease"? My gradle command: gradle tasks is giving Could not get unknown property 'appCenterUploadBetaRelease' for root project for this below line : appCenterUploadBetaRelease.dependsOn runMsBuild Not sure whether I am using this in a right way or not.

Panzenbaby commented 5 years ago

The task is not defined for your root projekt. But it is for your app module. So maybe :app:appCenterBetaRelease could help.

Be aware that the task name is generated by „appCenterUpload“ + flavor + build type

If you don‘t have a flavor „Beta“, there will be no task appCenterBetaRelease but maybe appCenterRelease

maverickabhi1991 commented 5 years ago

@Panzenbaby : Thanks for the quick response.I don't have app module in this scenario. Here is my code:

android { // ... flavorDimensions "environment" productFlavors { beta { dimension "environment" applicationIdSuffix ".beta" versionNameSuffix "-beta" } }

signingConfigs {
    release {
        storeFile file("C:/keyfile/ABC.keystore")
        storePassword 'PASSWORD'
        keyAlias 'ALIAS'
        keyPassword 'KEYPASSWORD'
    }
}

buildTypes {
    release {
        signingConfig android.signingConfigs.release
    }
}
}

appcenter {
apiToken = "TOKEN"                       // Api Token from AppCenter user profile
ownerName = "NAME"                          // Owner Name of the AppCenter Application
distributionGroups = ["GROUP"]               // Name of the AppCenter Distribution Group
releaseNotes = file("../ReleaseNotes.md")      // Can be a file or text
notifyTesters = false                        // Send mail to testers
apps {                                      // Here we manage 3 AppCenter applications : alpha, beta and 
    beta {
        dimension = "environment"
        appName = "APPNAME"
    }
}

}

I have added the dependency and applied the plugin.

Panzenbaby commented 5 years ago

So this is the code from your root build.gradle? Maybe this is the point. It is meant to be used inside a android app module gradle file like app/build.gradle

I think the plugin will not work in the root gradle file.

Panzenbaby commented 5 years ago

Oh. Your appcenter{} block is defined inside of the android part. Right? It should be outside of it.

android{ … } appcenter{ … }

oliviergauthier commented 5 years ago

Hi, thanks for the feedback. I have never tested the plugin on the root project, i will add some tests to check that it works. Sometime people forget to specify the flavor dimension. And as @Panzenbaby said, the appcenter declaration must be outside the android one. Can you share a git repository with a not working sample ? Thanks

oliviergauthier commented 5 years ago

@maverickabhi1991 is it working now ? Can i close this issue ?

maverickabhi1991 commented 5 years ago

@oliviergauthier : It didn't worked as u mentioned. I don't have app folder in my project and all the code is in main build.gradle file. Now I am using app center command line for deploying apk. Also, it would be great if you can support my case in this plugin. It was great. Thanks for the support.

oliviergauthier commented 5 years ago

@maverickabhi1991 can you provide me a sample project with the same architecture of yours. I'll try to make changes to support this kind of project.