问题描述
在我的Android Studio项目中,我有一个库模块和放大器;一个应用模块。两者都使用摇篮构建。
In my Android Studio project, I have a library module & a App module. Both use Gradle build.
MyProject
-LibraryModule
...
build.gradle
-AppModule
...
build.gradle
...
build.gradle
我需要在 classes.dex LibraryModule
的文件。
所以,我的Gradle运行的建立 LibraryModule
的Android Studio中的任务,它是成功的。
So, I run gradle's build task of LibraryModule
in Android Studio, it was successful.
然后,我试图找到其中生成的 classes.dex 文件,我只发现了一个在 MyProject的/建设/中间体/ DEX /发行/ classes.dex
,但它是一个旧文件(时间戳显示这是3天前产生的,我甚至不能确定它是如何生成的。)
Then, I tried to find where is the generated classes.dex file, I only found one under MyProject/build/intermediates/dex/release/classes.dex
, but it is an old file (Timestamp shows it was generated 2 days ago, I am not even sure how it has been generated.)
所以,Android Studio中,这里是位置的 classes.dex ?我怎样才能产生它(如果'建设任务不生成它)?
So, in Android Studio, where is the location for classes.dex? How can I generated it (if 'build' task doesn't generate it)?
好吧,这是奇怪的,但建立在Android中Studio是成功的,但是当我尝试在命令行下建库模块:
Ok, this is weird, though build in Android Studio is successful, but when I try to build in command line under library module:
./gradlew build --stacktrace
我得到了以下错误:
I got following error:
Caused by: org.gradle.api.plugins.PluginInstantiationException: Could not create plugin of type 'LibraryPlugin'.
at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:67)
at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:103)
at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68)
at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
这是什么意思的无法创建类型的插件'LibraryPlugin
推荐答案
在构建是全成与摇篮,在 classes.dex
位于:
Once the build is successfull with Gradle, the classes.dex
is located here:
./ YOURMODULE /编译/中间体/ DEX / YOURBUILDTYPE / classes.dex
(buildType通常是调试或释放)。
./YOURMODULE/build/intermediates/dex/YOURBUILDTYPE/classes.dex
(buildType is usually debug or release).
这对于摇篮0.11是真的。+截至目前。
This is true for Gradle 0.11.+ as of now.
这篇关于哪里是classes.dex文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!