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

22nd
Aug 2016
Perry
@pfn
Aug 22 2016 00:40
macros are generally undesirable
Rafal Wachol
@charafau
Aug 22 2016 06:47
I think circe has smaller dependencies than argonaut
but I might be wrong
Niklas Klein
@Taig
Aug 22 2016 07:58
Circe has cats, which is monstrous when it comes to method count
Don't know about Argonaut
Circe is an incredibly well organized and executed project though, love it
jhegedus42
@jhegedus42
Aug 22 2016 09:37
hmm thanks for the tip, who uses which?
circe vs argo?
Rafal Wachol
@charafau
Aug 22 2016 10:58
@Taig interesitng, I thought that circe would be smaller in method count
Niklas Klein
@Taig
Aug 22 2016 12:57
Its been a while since I checked. But when I first added a cats dependency (with 0.3.0 I think), I was immediately forced to use multidex
Having a total method count of 300k+
Yilin Wei
@yilinwei
Aug 22 2016 12:59
@Taig did you bother proguarding?
Niklas Klein
@Taig
Aug 22 2016 12:59
Yes, I always ProGuard, but it was still 1 or 2k methods too much
Yilin Wei
@yilinwei
Aug 22 2016 13:00
I'm surprised - we're using an fs2 + cats and we don't need to multidex.
Niklas Klein
@Taig
Aug 22 2016 13:00
But I think it was an underlying spire depenedency of cats which had tons of @specialized annotations
But it looks like this dependency is gone
Yilin Wei
@yilinwei
Aug 22 2016 13:00
(we're using spire as well)
Niklas Klein
@Taig
Aug 22 2016 13:00
Lol, sorry @specialized, accidental mention
Yilin Wei
@yilinwei
Aug 22 2016 13:01
The spec shouldn't affect it unless you're using each of the different types though
Niklas Klein
@Taig
Aug 22 2016 13:02
I'll have a look what my method count is nowadays
But my app is pretty bloated dependency-wise
Yilin Wei
@yilinwei
Aug 22 2016 13:03
I guess I'm a little confused because unless you're using the codepaths, proguard should pretty much take care of it.
Have you taken a look at the files which have been proguarded just to take a look at what's staying?
Niklas Klein
@Taig
Aug 22 2016 13:05
I probably did, but it's been a while. Depending on cats was a big decision back then because of its implications. Great if that changed
My last release build has 77835 methods
(After ProGuard :P)
Perry
@pfn
Aug 22 2016 13:56
it's probably proguard cache that blows up
well, yeah, if it blows up on a full proguard run, kinda stuck
Perry
@pfn
Aug 22 2016 14:09
I think I'll write a new method counter
so it'll error out before dx
Rafal Wachol
@charafau
Aug 22 2016 15:11
if someone would make method count table with popular scala libs that would be nice
jhegedus42
@jhegedus42
Aug 22 2016 15:12
so i need to switch to multidex with circe and not with argonaut?
Niklas Klein
@Taig
Aug 22 2016 15:14
It looks like that is no longer true
Circe should work without multidex as well
jhegedus42
@jhegedus42
Aug 22 2016 15:19
ok, thanks
Perry
@pfn
Aug 22 2016 15:21
@charafau, you can use methodcount.com
er
somethibg like that
methodscount.com
jhegedus42
@jhegedus42
Aug 22 2016 18:44
is there some kind of REPL that runs on the emulator ?
sbt console...
jhegedus42
@jhegedus42
Aug 22 2016 19:45
what is the sbt config needed for incremental multidex ?
things seem to go crazy with circe....
my cpu is overloaded when generating dex
but only if there is a proguard cache hit...
jhegedus42
@jhegedus42
Aug 22 2016 19:51
minSdkVersion := "21"
dexMulti := true
useProguardInDebug := false
is this gonna be incremental ?
hmmm....
> android:test
[info] Updating {file:/Users/joco/dev/android/scala/scala-android.org/project1/}project1...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Collecting resources
[info] Performing full resource merge
[info] Processing resources
[info] Rebuilding all classes because R.java has changed
[info] Regenerating TR.scala because R.java has changed
[info] Compiling 9 Scala sources and 2 Java sources to /Users/joco/dev/android/scala/scala-android.org/project1/target/android/intermediates/classes...
[warn] there were three deprecation warnings; re-run with -deprecation for details
[warn] one warning found
[info] Packaging resources: resources-debug.ap_
[info] Packaging /Users/joco/dev/android/scala/scala-android.org/project1/target/android/intermediates/classes.jar ...
[info] Done packaging.
[info] Pre-dexing: com.android.support.test-runner-0.5.jar
[info] Pre-dexing: com.android.support.test-exposed-instrumentation-api-publish-0.5.jar
[info] Pre-dexing: scala-library-2.11.8.jar
[info] Pre-dexing: circe-core_2.11-0.4.1.jar
[info] Pre-dexing: circe-numbers_2.11-0.4.1.jar
[info] Pre-dexing: cats-core_2.11-0.4.1.jar
[info] Pre-dexing: cats-macros_2.11-0.4.1.jar
[info] Pre-dexing: simulacrum_2.11-0.7.0.jar
[info] Pre-dexing: algebra_2.11-0.3.1.jar
[info] Pre-dexing: algebra-std_2.11-0.3.1.jar
[info] Pre-dexing: machinist_2.11-0.4.1.jar
[info] Pre-dexing: scala-reflect-2.11.8.jar
[info] Pre-dexing: circe-generic_2.11-0.4.1.jar
[info] Pre-dexing: macro-compat_2.11-1.1.1.jar
[info] Pre-dexing: shapeless_2.11-2.3.0.jar
[info] Pre-dexing: circe-parser_2.11-0.4.1.jar
[info] Pre-dexing: circe-jawn_2.11-0.4.1.jar
[info] Pre-dexing: jawn-parser_2.11-0.8.4.jar
[info] Pre-dexing: sqldroid-1.0.3.jar
[info] Pre-dexing: slick_2.11-3.0.0.jar
[info] Pre-dexing: slf4j-api-1.6.4.jar
[info] Pre-dexing: config-1.2.1.jar
[info] Pre-dexing: reactive-streams-1.0.0.jar
[info] Pre-dexing: scalatest_2.11-2.2.6.jar
[info] Pre-dexing: scala-xml_2.11-1.0.2.jar
[info] Pre-dexing: support-annotations-23.1.1.jar
[info] Pre-dexing: junit-4.12.jar
[info] Pre-dexing: hamcrest-core-1.3.jar
[info] Generating dex, incremental=false, multidex=true
[info] dex method count: 1059
[info] Packaged: project1-debug-unaligned.apk (11.08MB)
[info] Debug package does not need signing: project1-debug-unaligned.apk
[info] zipaligned: project1-debug.apk
[info] Installing to Android SDK built for x86_64 (emulator-5554)...
[error] Install failed: INSTALL_FAILED_DEXOPT
[error] (android:install) Install failed: INSTALL_FAILED_DEXOPT
[error] Total time: 118 s, completed Aug 22, 2016 10:54:46 PM
>
jhegedus42
@jhegedus42
Aug 22 2016 20:02
wiping does not help...
Niklas Klein
@Taig
Aug 22 2016 20:09

Perry
@pfn
Aug 22 2016 20:09
woot
[warn] C:\Users\pfnguyen\src\iota\sample\src\main\scala\iotatest\AnActivity.scala:213: wildcard ViewTree factory patterns cannot be typechecked
[warn]     case x => null
[warn]          ^
[error] C:\Users\pfnguyen\src\iota\sample\src\main\scala\iotatest\AnActivity.scala:212: not found in ViewTree: pattern 'doesnt.exist'
[error]     case "doesnt.exist" => null
[error]          ^
[error] C:\Users\pfnguyen\src\iota\sample\src\main\scala\iotatest\AnActivity.scala:211: ViewTree type mismatch;
[error]  found    : android.view.View
[error]  required : android.widget.TextView
[error]     case "sub.text" => new View(this)
[error]                        ^
[error] C:\Users\pfnguyen\src\iota\sample\src\main\scala\iotatest\AnActivity.scala:210: not found in ViewTree: pattern 'b'
[error]     case "text" | "a" | "b" | x if x.startsWith("c") => new TextView(this)
[error]                         ^
[error] C:\Users\pfnguyen\src\iota\sample\src\main\scala\iotatest\AnActivity.scala:210: not found in ViewTree: pattern 'a'
[error]     case "text" | "a" | "b" | x if x.startsWith("c") => new TextView(this)
[error]                   ^
[error] C:\Users\pfnguyen\src\iota\sample\src\main\scala\iotatest\AnActivity.scala:209: ViewTree factory type inspection failed
[error]   val r4 = ViewTree.inflateF(this, Nested) {
[error]                                            ^
[warn] 6 warnings found
[error] 6 errors found
fully type-checked inflateF :)
Niklas Klein
@Taig
Aug 22 2016 20:10
@jhegedus42 dexMaxHeap := "4096m",
dexMinimizeMain := false,
dexMulti := true,
sorry, at mobile
Perry
@pfn
Aug 22 2016 20:17
magical :)
multidex is never incremental
@jhegedus42 ignore the 'incremental' flag, it's irrelevant
pfn @pfn removes from next version
jhegedus42
@jhegedus42
Aug 22 2016 20:22
This message was deleted
thanks
Perry
@pfn
Aug 22 2016 20:26
as for dex taking forever, it's usually because you blew up methods in proguardCache hits
proguardCache += "cats" or whatever the correct package name for it is
jhegedus42
@jhegedus42
Aug 22 2016 20:26
hmm
thanks
i give that a try
jhegedus42
@jhegedus42
Aug 22 2016 20:57
Yes, because 21 comes with ART and native multidex support. Older versions need multidex support library with additional configuration. Also the older versions do not support incremental multidex builds and are therefore painfully slow.
@Taig said that multidex can be incremental
so I am confused
@Taig , is multidex incremental for you ? above 21 ?
If you set your minSdkVersion to 21 you can make use of incremental MultiDex which is rather fast. That is how I develop most of the time. Even though the actual minSdkVersion of my app is 15. But building / recompiling is a pain then because it takes so much longer. So I only develop / test for < 21 devices when necessary / specific problems arise.
Perry said that multidex is never incremental....
i am confused...
jhegedus42
@jhegedus42
Aug 22 2016 21:08
ok, multidex seems to work...
it does not take forever...
and seems to do some kind of incremental compilation
> android:test
[info] Compiling 1 Scala source to /Users/joco/dev/android/scala/scala-android.org/project1/target/android/intermediates/classes...
[warn] there was one deprecation warning; re-run with -deprecation for details
[warn] one warning found
[info] Packaging /Users/joco/dev/android/scala/scala-android.org/project1/target/android/intermediates/classes.jar ...
[info] Done packaging.
[info] Generating dex, incremental=false, multidex=true
[info] dex method count: 1060
[info] Packaged: project1-debug-unaligned.apk (11.08MB)
[info] Debug package does not need signing: project1-debug-unaligned.apk
[info] zipaligned: project1-debug.apk
[info] Installing to Android SDK built for x86_64 (emulator-5554)...
[info] [project1-debug.apk] Install finished: 11.08MB in 31.00s. 365.99KB/s
[info] Testing on Android SDK built for x86_64 (emulator-5554)...
[info]  - testOne (com.mypackage.test.Tester)
[info]  - testTwo (com.mypackage.test.Tester)
[info]  - testDB (mypackage.test.plainSqlTest.PlainSQLTest)
[success] Total time: 47 s, completed Aug 23, 2016 12:08:48 AM
>
even instrumentation test work
transferring 11MB takes forever though
Perry
@pfn
Aug 22 2016 22:14
multidex cannot be incremental, period
nothing to be confused about
ignore any notion of incremental and dex
it makes no difference
it's just an internal implementation detail
@Taig's terminology is incorrect it's not "incremental multidex" as he describes