when I run task publish in library, I got the following error:
* What went wrong:
Could not determine the dependencies of task ':android-library2:publishMavenandroid-library2SitReleaseAarPublicationToMavenLocalRepository'.
> Publishing is not able to resolve a dependency on a project with multiple publications that have different coordinates.
Found the following publications in project ':android-library':
- Maven publication 'mavenandroid-libraryPrdDebugAar' with coordinates com.cestbon.android.saleshelp:android-library-PrdDebug:1.0
- Maven publication 'mavenandroid-libraryPrdReleaseAar' with coordinates com.cestbon.android.saleshelp:android-library-PrdRelease:1.0
- Maven publication 'mavenandroid-libraryDevDebugAar' with coordinates com.cestbon.android.saleshelp:android-library-DevDebug:1.0
- Maven publication 'mavenandroid-libraryDevReleaseAar' with coordinates com.cestbon.android.saleshelp:android-library-DevRelease:1.0
- Maven publication 'mavenandroid-libraryUatDebugAar' with coordinates com.cestbon.android.saleshelp:android-library-UatDebug:1.0
- Maven publication 'mavenandroid-libraryUatReleaseAar' with coordinates com.cestbon.android.saleshelp:android-library-UatRelease:1.0
- Maven publication 'mavenandroid-librarySitDebugAar' with coordinates com.cestbon.android.saleshelp:android-library-SitDebug:1.0
- Maven publication 'mavenandroid-librarySitReleaseAar' with coordinates com.cestbon.android.saleshelp:android-library-SitRelease:1.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
If I removed apply from: '../publish.gradle' in build.gradle of library2, task :library:publish can be run successfully. But because of I want to publish library2 independently, so library2 must apply from: '../publish.gradle'
I answered your question on stackoverflow, because I think this is not an android-maven-publish plugin bug, this is a limitation of the original maven-publish plugin.
I have 2 lib modules :
library
,library2
build.gradle
in library:build.gradle
in library2:publish.gradle:
when I run task
publish
in library, I got the following error:If I removed
apply from: '../publish.gradle'
inbuild.gradle
of library2, task:library:publish
can be run successfully. But because of I want to publishlibrary2
independently, solibrary2
mustapply from: '../publish.gradle'
How can I do for this error? Thanks.