项目中有用到github中maven上的库,项目编译时报错:
No service of type Factory<LoggingManagerInternal> available in ProjectScopeServices.
截图如下:
首先,确保classpath对应的是android-maven-gradle-plugin,而不是android-maven-plugin。
然后,发现是apply plugin: 'com.github.dcendents.android-maven' 这个地方报的错。
这是因为:
不同的gradle版本需要不同maven-gradle-plugin版本。
不同版本对照参考:https://github.com/dcendents/android-maven-gradle-plugin
项目所用的gradle版本是4.6
所以, 对照来说,maven-gradle-plugin版本应该用2.1
即:
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
至此,问题解决。