在 Android Studio 中使用 AAR
Using AAR's in Android Studio
我有两个项目在 Android 中使用 Calligraphy Library 自定义字体。我在两个项目中以完全相同的方式将 Calligraphy aar 依赖项/模块添加到项目中,除了一个项目可以看到命名空间而另一个不能..
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
在一个项目中找到它,在另一个项目中找不到..
Both of them I created a "new module" and selected an existing AAR to
base it off. Then added through the gui the dependency, which does the
same as manually throwing: compile project(':calligraphy-2.0.2')
into the main project's build.gradle file and , ':calligraphy-2.0.2'
into the projects settings.gradle file.
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
第一个有效,第二个失败...
import uk.co.chrisjenx.calligraphy.R;
然而,在第二个工作..但不允许我使用 CalligraphyContextWrapper..
上述方法有效。该错误似乎出现在 IDE (Android Studio) 中。它说它找不到导入的库,但是到了编译和执行时间,它按预期工作。什么!?
为什么会这样,有人知道吗? 显然在构建时找不到库,然后它就找到了..
我有两个项目在 Android 中使用 Calligraphy Library 自定义字体。我在两个项目中以完全相同的方式将 Calligraphy aar 依赖项/模块添加到项目中,除了一个项目可以看到命名空间而另一个不能..
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
在一个项目中找到它,在另一个项目中找不到..
Both of them I created a "new module" and selected an existing AAR to base it off. Then added through the gui the dependency, which does the same as manually throwing:
compile project(':calligraphy-2.0.2')
into the main project's build.gradle file and, ':calligraphy-2.0.2'
into the projects settings.gradle file.
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
第一个有效,第二个失败...import uk.co.chrisjenx.calligraphy.R;
然而,在第二个工作..但不允许我使用 CalligraphyContextWrapper..
上述方法有效。该错误似乎出现在 IDE (Android Studio) 中。它说它找不到导入的库,但是到了编译和执行时间,它按预期工作。什么!?
为什么会这样,有人知道吗? 显然在构建时找不到库,然后它就找到了..