纯Java模块中的StringDef? [英] StringDef in pure java module?

查看:280
本文介绍了纯Java模块中的StringDef?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用gradle,我有两个模块,:android :core ,其中 :包含所有业务逻辑的包含特定于android的内容和包含:core

Using gradle, I have two modules, :android and :core, with :android containing the android-specific stuff and :core containing all the business logic.

我有一堆枚举值,所以很自然,我将它们转换为StringDef。问题是我似乎无法在我的:core -module中使用Support-Annotations,gradle抱怨说它无法解析 com.android .support:support-annotations:25.3.1

I had a bunch of enum values, so naturally, I converted them to StringDef. Problem is that I can't seem to use Support-Annotations in my :core-module, gradle complains that it can't resolve com.android.support:support-annotations:25.3.1

我可以在这里做什么?

What can I do here?

推荐答案

在挖掘了一下后找到了解决方案。在您的项目级build.gradle中,您需要将sdk-path添加到存储库。

Found the solution after digging around a bit. In your project-level build.gradle, you need to add your sdk-path to repositories.

它看起来像这样

allprojects {
  repositories {
    jcenter()
    maven { url '<your-SDK-path>/extras/android/m2repository' }
  }
}

这篇关于纯Java模块中的StringDef?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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