如何使用 android 模块和 运行 使用 Intellij Ultimate 创建 sbt 项目?
How to create sbt project with an android module and run with Intellij ultimate?
我已经尝试在 sbt 中创建一个 android 项目大约 2 天了,我得到了很多 运行。从一开始我就一直按照本教程来创建 sbt+android+intellij IDE project. which then directed me towards the android-sdk-plugin。在我终于能够在命令行中执行 sbt gen-android
命令创建一个 android 项目之前,我必须下载 sdks 并设置路径。但是,当创建 android sbt 项目时,以下 cmd 行命令 android update project -p .
不会执行,因为清单不在根文件夹中。
我通过查看类型安全的 scaloid 模板示例进行了故障排除。所以,我的解决方法是将清单文件和 res 文件都传输到 sbt 项目的根目录,并将 android 包移动到 src 文件夹的根目录,以使 android update
工作。在导入同一项目后,我的 sbt 项目将在终端中编译而不是在 intellij 中编译。
在开始这个过程之前,尝试创建一个仅包含 IDE 的 sbt android 项目时,我在编译期间收到 ANDROID_HOME not set 错误。现在,在 PATHS 和 sdks 的一切都设置好之后,我在 sbt 编译时收到以下错误..
[info] Processing resources
[trace] Stack trace suppressed: run 'last compile:compile' for the full output.
[error] (compile:compile) java.lang.IllegalArgumentException: Lint must be invoked with the System property com.android.tools.lint.bindir pointing to the ANDROID_SDK tools directory
在终端中,我在 sbt compile
..
之后得到的完全相同的文件夹
[info] Loading global plugins from /Users/StramzCB/.sbt/0.13/plugins
[info] Loading project definition from /Users/StramzCB/Desktop/sbt+intJ/hello-scaloid-sbt-master/project
[info] Set current project to hello-scaloid-sbt (in build file:/Users/StramzCB/Desktop/sbt+intJ/hello-scaloid-sbt-master/)
[info] Processing resources
[success] Total time: 1 s, completed Jul 22, 2015 2:36:10 PM
请帮助我了解当前创建和 android+sbt+intellij 项目的正确方法。否则,由于 65k 的方法限制,我可能不得不将源文件复制到 sbt 项目中以编译 apk。
sbt gen-android
导入intellij。
完成
先决条件:设置所有主要 sdk 的路径,即 android、java、scala、sbt、maven、gradle。你用过什么。
最终对我有用的不是将 gen-ndroid 作为 sbt 项目导入到 intellij,而是我在以下方面取得了成功..
1.Creating 一个带有 intellij Ultimate 的新 sbt 项目
2.Creating sbt 项目中的一个子模块 android 项目
3.Updating android 项目
: android update project -p .
: sbt gen-android-sbt // from the android-sdk-plugin for sbt
5.run 在终端中使用一些清理和编译命令来验证功能
6.Open 使用 intellij 的 Sbt 项目并将 运行 配置更改为 运行 sbt 命令,如
android:run
- 它有效,但我的主要问题是我的 intellij sbt 与我的终端 sbt 不同步。
就插件和注册资源而言,它与终端环境相比有所欠缺。由于这个问题,我为 sbt 删除了一些非托管库,出于明显的原因写入 ide 并从终端写入 运行 sbt 命令。一些库导入但没有进入子项目,所以我使用非托管库,即 android.support.v4.
到目前为止,只要它编译并给我 apks,我就没有抱怨。
这是我 2 天的愤怒资源,终于得到了一个野兽代码环境。我需要 Sbt 的全部原因是为了减小包的大小。
https://github.com/pfn/android-sdk-plugin
http://macroid.github.io/ScalaOnAndroid.html
http://www.scala-sbt.org/0.12.2/docs/Getting-Started/Multi-Project.html
IntelliJ 14 - Create / Import a Scala / SBT project
https://github.com/pocorall/hello-scaloid-sbt
http://www.47deg.com/blog/scala-on-android-preparing-the-environment
我有一个最近才对我有用的解决方案,它是在 Intellij IDEA 中创建 android sbt 项目的最佳方式。
使用 pfn android sdk sbt plugin + intellij 中的 SBT 和 Scala 插件,我做了以下操作。
- 创建 SBT 项目
- 在项目根目录打开终端并运行 sbt "gen-android android-21 com.some.your-pack testName"
- 现在在 Intellij 中,通知会注意到 android 模板,然后将 android 模板导入到您的项目中
- 这解决了我在项目名称创建两个重叠模块时遇到的问题,一个以包命名,一个是名称
我已经尝试在 sbt 中创建一个 android 项目大约 2 天了,我得到了很多 运行。从一开始我就一直按照本教程来创建 sbt+android+intellij IDE project. which then directed me towards the android-sdk-plugin。在我终于能够在命令行中执行 sbt gen-android
命令创建一个 android 项目之前,我必须下载 sdks 并设置路径。但是,当创建 android sbt 项目时,以下 cmd 行命令 android update project -p .
不会执行,因为清单不在根文件夹中。
我通过查看类型安全的 scaloid 模板示例进行了故障排除。所以,我的解决方法是将清单文件和 res 文件都传输到 sbt 项目的根目录,并将 android 包移动到 src 文件夹的根目录,以使 android update
工作。在导入同一项目后,我的 sbt 项目将在终端中编译而不是在 intellij 中编译。
在开始这个过程之前,尝试创建一个仅包含 IDE 的 sbt android 项目时,我在编译期间收到 ANDROID_HOME not set 错误。现在,在 PATHS 和 sdks 的一切都设置好之后,我在 sbt 编译时收到以下错误..
[info] Processing resources
[trace] Stack trace suppressed: run 'last compile:compile' for the full output.
[error] (compile:compile) java.lang.IllegalArgumentException: Lint must be invoked with the System property com.android.tools.lint.bindir pointing to the ANDROID_SDK tools directory
在终端中,我在 sbt compile
..
[info] Loading global plugins from /Users/StramzCB/.sbt/0.13/plugins
[info] Loading project definition from /Users/StramzCB/Desktop/sbt+intJ/hello-scaloid-sbt-master/project
[info] Set current project to hello-scaloid-sbt (in build file:/Users/StramzCB/Desktop/sbt+intJ/hello-scaloid-sbt-master/)
[info] Processing resources
[success] Total time: 1 s, completed Jul 22, 2015 2:36:10 PM
请帮助我了解当前创建和 android+sbt+intellij 项目的正确方法。否则,由于 65k 的方法限制,我可能不得不将源文件复制到 sbt 项目中以编译 apk。
sbt gen-android
导入intellij。 完成
先决条件:设置所有主要 sdk 的路径,即 android、java、scala、sbt、maven、gradle。你用过什么。
最终对我有用的不是将 gen-ndroid 作为 sbt 项目导入到 intellij,而是我在以下方面取得了成功..
1.Creating 一个带有 intellij Ultimate 的新 sbt 项目
2.Creating sbt 项目中的一个子模块 android 项目
3.Updating android 项目
: android update project -p .
: sbt gen-android-sbt // from the android-sdk-plugin for sbt
5.run 在终端中使用一些清理和编译命令来验证功能
6.Open 使用 intellij 的 Sbt 项目并将 运行 配置更改为 运行 sbt 命令,如
android:run
- 它有效,但我的主要问题是我的 intellij sbt 与我的终端 sbt 不同步。
就插件和注册资源而言,它与终端环境相比有所欠缺。由于这个问题,我为 sbt 删除了一些非托管库,出于明显的原因写入 ide 并从终端写入 运行 sbt 命令。一些库导入但没有进入子项目,所以我使用非托管库,即 android.support.v4.
到目前为止,只要它编译并给我 apks,我就没有抱怨。
这是我 2 天的愤怒资源,终于得到了一个野兽代码环境。我需要 Sbt 的全部原因是为了减小包的大小。
https://github.com/pfn/android-sdk-plugin
http://macroid.github.io/ScalaOnAndroid.html
http://www.scala-sbt.org/0.12.2/docs/Getting-Started/Multi-Project.html
IntelliJ 14 - Create / Import a Scala / SBT project
https://github.com/pocorall/hello-scaloid-sbt
http://www.47deg.com/blog/scala-on-android-preparing-the-environment
我有一个最近才对我有用的解决方案,它是在 Intellij IDEA 中创建 android sbt 项目的最佳方式。
使用 pfn android sdk sbt plugin + intellij 中的 SBT 和 Scala 插件,我做了以下操作。
- 创建 SBT 项目
- 在项目根目录打开终端并运行 sbt "gen-android android-21 com.some.your-pack testName"
- 现在在 Intellij 中,通知会注意到 android 模板,然后将 android 模板导入到您的项目中
- 这解决了我在项目名称创建两个重叠模块时遇到的问题,一个以包命名,一个是名称