These are chat archives for scala-android/sbt-android

24th
Aug 2016
Niklas Klein
@Taig
Aug 24 2016 06:54
<3
that's perfect
Just curious about the .container call at the end. Couldn't the nest function return that already? Or would we lose some kind of flexibility? Looks like something I'd keep forgetting all the time
Also :thumbsup: for the exhaustive documentation
Niklas Klein
@Taig
Aug 24 2016 07:03
Can't wait to ditch thousands of lines of view code with that
Rafal Wachol
@charafau
Aug 24 2016 07:06
yes, it looks very promising :) good job
Perry
@pfn
Aug 24 2016 13:46
@Taig, it's possible to drop the container call and just return it
James N
@jojojames
Aug 24 2016 16:42
i'm looking to add a local aar dependency to my project. im using sbt-android-gradle to get the build file from gradle. where should i (more like how :)) add this dependency
Perry
@pfn
Aug 24 2016 17:17
said yesterday already @jojojames use localAars += baseDirectory.value / path / to / aar
James N
@jojojames
Aug 24 2016 17:23
@pfn, not sure where to add that since the sbt file is auto generated (definitely ignorant to the build system), i'm trying a couple different things right now though
Perry
@pfn
Aug 24 2016 17:24
create a new file, build.sbt, in the app/ folder add it there, and you're done
James N
@jojojames
Aug 24 2016 17:28
i'll give that a shot
Rafal Wachol
@charafau
Aug 24 2016 18:03
if you have any more questions, ask
also, maybe it would be better to write sbt file by hand /
Perry
@pfn
Aug 24 2016 18:05
nah, not if you're importing from gradle
Perry
@pfn
Aug 24 2016 18:34
if you have an existing and working build.gradle it's almost never worth writing an sbt file
only adding rules as necessary to make the build work
(unless you have a bone-stock build.gradle, then creating a build.sbt is much easier)
Niklas Klein
@Taig
Aug 24 2016 18:47
I'm kinda curious now what bone-stock means :innocent:
Perry
@pfn
Aug 24 2016 19:08
I mean, barebones, unmodified
i.e. if you have a build.gradle that was generated by android studio and have never modified it, then it's much easier to just create a new build.sbt with: lazy val app = project.settings(androidBuild)
and you're done
oh, and have to set platformTarget
always forget that...
maybe I'll update that to use highest available in local sdk if not set...
Rafal Wachol
@charafau
Aug 24 2016 20:00
Will it's all good, but you still need to add dependencies sometimes
Like annotation preprocessor for dagger
I still didn't touch Google libs from SBT, is it any problem?
Perry
@pfn
Aug 24 2016 20:48
what problem?
James N
@jojojames
Aug 24 2016 21:09
i ended up just fixing my ghetto aar wrapper and imported the wrapper directly in my initial build gradle file
the build proceeds from there but now i'm getting a outofmemoryerror: gc overhead limit exceeded when dexing the app
http://pastebin.com/QE0LjiaV i'm guessing the GC is either similar or 1:1 with the java gc so i'll try to work from there, any tips would be appreciated here though
Perry
@pfn
Aug 24 2016 22:36
either enable proguard or increase dex limit
why aren't you using 1.6.14?
@jojojames
James N
@jojojames
Aug 24 2016 23:20
@pfn, i saw the note about it but wasnt sure if thered be any ~strange~ incompatibilities so i just went with the default the gradle gave me
Perry
@pfn
Aug 24 2016 23:25
no, but there is info that helps tell you that dex will fail
dexMaxHeap := "4g" @jojojames
James N
@jojojames
Aug 24 2016 23:27
and that goes into a 'build.sbt' file in the specific project im running right?
James N
@jojojames
Aug 24 2016 23:47
http://pastebin.com/QyPTyTSn Hmnn, I set it at 8g and it still failed.
@pfn, mention ;)
Perry
@pfn
Aug 24 2016 23:47
did you set it in testapp/ @jojojames ?
[error] (testapp/android:dex) com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: ForkOptions(None,Some(CustomOutput()),List(),None,Buffer(-Xmx1024m, -cp, /Applications/adt-bundle-mac-x86_64-20140702/sdk/build-tools/23.0.2/lib/dx.jar),false,Map())
you didn't set it
anyway, in all likelihood, you need to enable proguard
James N
@jojojames
Aug 24 2016 23:48
i initially put it there but i must have gotten an unrelated error (so i reverted that part)
Perry
@pfn
Aug 24 2016 23:49
set dexMaxHeap again then
James N
@jojojames
Aug 24 2016 23:49
yeah giving it a shot
@pfn looks like the build went through but it still errored out at end with 'ndk-build failed!'
you might be right about the proguard (it says dex method count: 123537)
Perry
@pfn
Aug 24 2016 23:52
yes, you need to enable proguard
useProguard := true and useProguardInDebug := true
and if ndk-build failed, then fix the failure :P