美文网首页
android组件化生成apk报错

android组件化生成apk报错

作者: ryanxun | 来源:发表于2021-04-02 09:07 被阅读0次
嘿,今天的你过的还好吗

今天组件化项目生成apk时候报错了

Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':basic:advancedRuntimeClasspath'.
   > Could not resolve project :arouter.
     Required by:
         project :basic
      > No matching variant of project :arouter was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'advanced' but:
          - Variant 'debugApiElements' capability Slaughter:arouter:unspecified:
              - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'advanced'
          - Variant 'debugRuntimeElements' capability Slaughter:arouter:unspecified declares a runtime of a component:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'advanced'
          - Variant 'releaseApiElements' capability Slaughter:arouter:unspecified:
              - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'advanced'
          - Variant 'releaseRuntimeElements' capability Slaughter:arouter:unspecified declares a runtime of a component:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'advanced'
   > Could not resolve project :common.
     Required by:
         project :basic
      > No matching variant of project :common was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'advanced' but:
          - Variant 'debugApiElements' capability Slaughter:common:unspecified:
              - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'advanced'
          - Variant 'debugRuntimeElements' capability Slaughter:common:unspecified declares a runtime of a component:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'advanced'
          - Variant 'releaseApiElements' capability Slaughter:common:unspecified:
              - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'advanced'
          - Variant 'releaseRuntimeElements' capability Slaughter:common:unspecified declares a runtime of a component:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'advanced'


猛地一瞅,这啥玩意,仔细一瞅 还不如猛的一瞅

然后我翻译了一下

您上传了可调试的APK。出于安全原因,您需要先禁用调试,然后才能在GooglePlay中发布。了解有关可调试的APK的更多信息。

然后看了一下,我自己写的注解处理器不属于第三方,每次运行都会进行调试

定位到问题了,解决办法就有了

在app.gradle里添加以下代码

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

打包生成 ok,解决

没更新动态或者频繁更新动态的时候都是在认真生活

相关文章

网友评论

      本文标题:android组件化生成apk报错

      本文链接:https://www.haomeiwen.com/subject/tqsfkltx.html