指定使用 sbt android-plugin 编译的 Java 项目中 AndroidManifest.xml 的位置
我正在尝试使用 sbt 编译一个用 Java 编写的 Android 项目,我刚刚继承了该项目并希望使用 Scala 进行改进。
该项目分为几个模块。我使用“g8 jberkel/android-app -b sbt-0_11
”创建了一个 sbt 项目,将所有模块复制到 src/ ,留下:
my-android-project ls -l src
total 96
drwxr-xr-x 14 tiagoboldt staff 476 Oct 18 16:09 AndroidApplication
drwxr-xr-x 8 tiagoboldt staff 272 Oct 18 16:09 CRCCalculatioNTool
drwxr-xr-x 10 tiagoboldt staff 340 Oct 18 16:09 CaretakerIntegration
drwxr-xr-x 13 tiagoboldt staff 442 Oct 18 16:09 ConsoleSensorNetwork
... and so on
这些模块之间具有依赖关系,AndroidApplication 是我想构建的主要应用程序。我一直在尝试编辑我的project/build.scala,我已将其从原始版本更改为包含以下内容:
object AndroidBuild extends Build {
lazy val AndroidApplication = Project (
"AndroidApplication",
file("."),
settings = General.fullAndroidSettings ++ PlainJavaProject.settings
)
}
在尝试构建时,我总是以:
java.io.FileNotFoundException: (rest_of_dir)/my-android-project/src/main/AndroidManifest.xml (No such file or directory)
我无法理解如何配置它来拥有它在 src/AndroidApplication/src/AndroidManifest.xml 中查找该文件,而不是默认文件。已经尝试使用文件值但不行:\
sbt 及其 android 插件的文档没有帮助。任何帮助将不胜感激。
I'm trying to use sbt to compile an Android Project made in Java, which I just inherited and want to improve with Scala.
The project is splited across several modules. I've created an sbt project with "g8 jberkel/android-app -b sbt-0_11
", copied all the modules to src/ leaving me with:
my-android-project ls -l src
total 96
drwxr-xr-x 14 tiagoboldt staff 476 Oct 18 16:09 AndroidApplication
drwxr-xr-x 8 tiagoboldt staff 272 Oct 18 16:09 CRCCalculatioNTool
drwxr-xr-x 10 tiagoboldt staff 340 Oct 18 16:09 CaretakerIntegration
drwxr-xr-x 13 tiagoboldt staff 442 Oct 18 16:09 ConsoleSensorNetwork
... and so on
These modules have dependencies between them, AndroidApplication is the main application I want to build. I've been trying to edit my project/build.scala, which I've altered from the original to include the following :
object AndroidBuild extends Build {
lazy val AndroidApplication = Project (
"AndroidApplication",
file("."),
settings = General.fullAndroidSettings ++ PlainJavaProject.settings
)
}
While trying to build, I always end up with:
java.io.FileNotFoundException: (rest_of_dir)/my-android-project/src/main/AndroidManifest.xml (No such file or directory)
I can't understand how to configure it to have it look for that file in src/AndroidApplication/src/AndroidManifest.xml, instead of the default one. Already tried to play with the file value and no go :\
The documentation of both sbt and it's android plugin didn't help. Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
与 libgdx 一起,我只使用了这个:
Along with libgdx, I just used this:
希望这有帮助:
Hopefully this helps:
如果您尝试配置插件以更改默认路径,那么我认为您还需要配置设置
manifestTemplatePath
:删除
manifestTemplatePath
,您将收到错误正在看到。in case you are trying to configure the plugin to change the default paths then i think you also need to configure the setting
manifestTemplatePath
:Remove
manifestTemplatePath
and you'll get the error you're seeing.