New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaloid and dex method count limit #83

Closed
longliveenduro opened this Issue May 8, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@longliveenduro

Using the sbt android-sdk-plugin we run into the dex method limit (if we don't specify clean on every package), and scalaoid seems to count ~ 50000 to this limit (see the "[warn] 50446 org.scaloid.common" below)

/opt/sbt-0.13.2/bin/sbt android:package
[info] Loading global plugins from /home/chris/.sbt/0.13/plugins
[info] Loading project definition from /home/chris/prj/android/android-app/project
[info] Set current project to gutefrage.net Android App (in build file:/home/chris/prj/android/android-app/)
[info] Generating R.java
[info] Regenerating TR.scala because R.java has changed
[info] Compiling 1 Java source to /home/chris/prj/android/android-app/target/android-bin/classes...
[info] Packaging /home/chris/prj/android/android-app/target/android-bin/classes.jar ...
[info] Done packaging.
[info] Finding dependency references for: classes.jar
[info] [debug] cache hit, skipping proguard!
[info] [debug] Forcing clean dex
[info] Generating classes.dex
[warn] 
[warn] trouble writing output: Too many method references: 87874; max is 65536.
[warn] You may try using --multi-dex option.
[warn] References by package:
[warn]     17 android.app
[warn]      3 android.appwidget
[warn]     59 android.content
[warn]     10 android.content.res
[warn]     11 android.database
[warn]     32 android.gesture
[warn]     58 android.graphics
[warn]      1 android.graphics.drawable
[warn]     12 android.inputmethodservice
[warn]      3 android.media
[warn]      1 android.net
[warn]     12 android.opengl
[warn]      7 android.os
[warn]     59 android.preference
[warn]      2 android.telephony
[warn]      2 android.text
[warn]     12 android.util
[warn]    156 android.view
[warn]     21 android.webkit
[warn]    577 android.widget
[warn]    155 com.fasterxml.jackson.annotation
[warn]    480 com.fasterxml.jackson.core
[warn]    148 com.fasterxml.jackson.core.base
[warn]     34 com.fasterxml.jackson.core.format
[warn]    159 com.fasterxml.jackson.core.io
[warn]    425 com.fasterxml.jackson.core.json
[warn]    100 com.fasterxml.jackson.core.sym
[warn]     25 com.fasterxml.jackson.core.type
[warn]    286 com.fasterxml.jackson.core.util
[warn]   1179 com.fasterxml.jackson.databind
[warn]     39 com.fasterxml.jackson.databind.annotation
[warn]    166 com.fasterxml.jackson.databind.cfg
[warn]    514 com.fasterxml.jackson.databind.deser
[warn]    271 com.fasterxml.jackson.databind.deser.impl
[warn]    572 com.fasterxml.jackson.databind.deser.std
[warn]     18 com.fasterxml.jackson.databind.exc
[warn]     41 com.fasterxml.jackson.databind.ext
[warn]    680 com.fasterxml.jackson.databind.introspect
[warn]    100 com.fasterxml.jackson.databind.jsonFormatVisitors
[warn]     12 com.fasterxml.jackson.databind.jsonschema
[warn]     61 com.fasterxml.jackson.databind.jsontype
[warn]    196 com.fasterxml.jackson.databind.jsontype.impl
[warn]     64 com.fasterxml.jackson.databind.module
[warn]    635 com.fasterxml.jackson.databind.node
[warn]    279 com.fasterxml.jackson.databind.ser
[warn]    252 com.fasterxml.jackson.databind.ser.impl
[warn]    621 com.fasterxml.jackson.databind.ser.std
[warn]    301 com.fasterxml.jackson.databind.type
[warn]    459 com.fasterxml.jackson.databind.util
[warn]     68 com.fasterxml.jackson.module.scala
[warn]    569 com.fasterxml.jackson.module.scala.deser
[warn]    212 com.fasterxml.jackson.module.scala.experimental
[warn]    538 com.fasterxml.jackson.module.scala.introspect
[warn]    101 com.fasterxml.jackson.module.scala.modifiers
[warn]    251 com.fasterxml.jackson.module.scala.ser
[warn]    132 com.fasterxml.jackson.module.scala.util
[warn]      1 com.google.code.rome.android.repackaged.com.sun.syndication.feed
[warn]      1 com.google.code.rome.android.repackaged.com.sun.syndication.feed.synd
[warn]      9 com.google.code.rome.android.repackaged.com.sun.syndication.io
[warn]      3 com.google.common.annotations
[warn]    755 com.google.common.base
[warn]      7 com.google.common.base.internal
[warn]    845 com.google.common.cache
[warn]   8134 com.google.common.collect
[warn]     74 com.google.common.escape
[warn]     53 com.google.common.eventbus
[warn]    444 com.google.common.hash
[warn]      3 com.google.common.html
[warn]    696 com.google.common.io
[warn]    102 com.google.common.math
[warn]    152 com.google.common.net
[warn]    511 com.google.common.primitives
[warn]    483 com.google.common.reflect
[warn]   1088 com.google.common.util.concurrent
[warn]      4 com.google.common.xml
[warn]     11 com.google.gson
[warn]    103 com.thoughtworks.paranamer
[warn]      8 default
[warn]      2 java.beans
[warn]    167 java.io
[warn]    400 java.lang
[warn]      1 java.lang.annotation
[warn]     13 java.lang.ref
[warn]     92 java.lang.reflect
[warn]     63 java.math
[warn]     73 java.net
[warn]     38 java.nio
[warn]      3 java.nio.channels
[warn]      6 java.nio.charset
[warn]     15 java.security
[warn]      2 java.security.cert
[warn]      5 java.sql
[warn]     21 java.text
[warn]    439 java.util
[warn]    145 java.util.concurrent
[warn]     39 java.util.concurrent.atomic
[warn]     41 java.util.concurrent.locks
[warn]     10 java.util.jar
[warn]      7 java.util.logging
[warn]     17 java.util.regex
[warn]     15 java.util.zip
[warn]     22 javax.annotation
[warn]      1 javax.annotation.concurrent
[warn]      8 javax.annotation.meta
[warn]      1 javax.inject
[warn]      8 javax.net.ssl
[warn]      4 javax.xml.datatype
[warn]      1 javax.xml.namespace
[warn]      4 javax.xml.parsers
[warn]      3 javax.xml.transform
[warn]      3 javax.xml.transform.dom
[warn]      1 javax.xml.transform.sax
[warn]      2 javax.xml.transform.stream
[warn]    192 net.gutefrage.android
[warn]    127 net.gutefrage.android.rest
[warn]      4 net.gutefrage.android.rest.jackson
[warn]     14 net.gutefrage.android.rest.support
[warn]      9 net.gutefrage.android.util
[warn]     18 org.apache.commons.httpclient
[warn]      9 org.apache.commons.httpclient.methods
[warn]      2 org.apache.commons.httpclient.params
[warn]     10 org.apache.http
[warn]      3 org.apache.http.client
[warn]     11 org.apache.http.client.methods
[warn]      1 org.apache.http.conn
[warn]      3 org.apache.http.conn.params
[warn]      4 org.apache.http.conn.scheme
[warn]      1 org.apache.http.conn.ssl
[warn]      1 org.apache.http.entity
[warn]      1 org.apache.http.impl.client
[warn]      1 org.apache.http.impl.conn.tsccm
[warn]      3 org.apache.http.params
[warn]      4 org.codehaus.jackson
[warn]      7 org.codehaus.jackson.map
[warn]      1 org.codehaus.jackson.map.type
[warn]      1 org.scaloid
[warn]  50446 org.scaloid.common
[warn]     34 org.scaloid.util
[warn]      2 org.simpleframework.xml
[warn]      1 org.simpleframework.xml.core
[warn]     18 org.springframework.beans
[warn]      1 org.springframework.beans.factory
[warn]    106 org.springframework.core
[warn]    111 org.springframework.core.io
[warn]    202 org.springframework.http
[warn]    140 org.springframework.http.client
[warn]     14 org.springframework.http.client.support
[warn]     89 org.springframework.http.converter
[warn]     17 org.springframework.http.converter.feed
[warn]     44 org.springframework.http.converter.json
[warn]     36 org.springframework.http.converter.xml
[warn]    364 org.springframework.util
[warn]     49 org.springframework.util.support
[warn]    130 org.springframework.web.client
[warn]      4 org.springframework.web.client.support
[warn]    200 org.springframework.web.util
[warn]      2 org.w3c.dom.bootstrap
[warn]      2 org.w3c.dom.ls
[warn]      2 org.xml.sax
[warn]    377 scala
[warn]   1792 scala.collection
[warn]    333 scala.collection.convert
[warn]    171 scala.collection.generic
[warn]   2337 scala.collection.immutable
[warn]   2554 scala.collection.mutable
[warn]      2 scala.compat
[warn]     31 scala.concurrent
[warn]    140 scala.concurrent.forkjoin
[warn]     59 scala.concurrent.impl
[warn]      1 scala.concurrent.util
[warn]      1 scala.io
[warn]    678 scala.math
[warn]    210 scala.reflect
[warn]    115 scala.runtime
[warn]     75 scala.sys
[warn]    121 scala.util
[warn]     19 scala.util.control
[warn]     32 scala.util.hashing
[warn]     13 scala.util.matching
[warn]     15 sun.misc
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    /opt/android-sdk-linux/build-tools/19.0.3/dx -JXmx1024m --dex --incremental --no-strict --output /home/chris/prj/android/android-app/target/android-bin/classes.dex /home/chris/.ivy2/cache/org.scaloid/scaloid_2.11/jars/scaloid_2.11-3.3-8.jar /home/chris/.ivy2/cache/com.google.guava/guava/bundles/guava-15.0.jar /home/chris/.ivy2/cache/com.fasterxml.jackson.core/jackson-core/bundles/jackson-core-2.4.0-rc1.jar /home/chris/.ivy2/cache/com.thoughtworks.paranamer/paranamer/jars/paranamer-2.6.jar /home/chris/.ivy2/cache/com.fasterxml.jackson.core/jackson-databind/bundles/jackson-databind-2.4.0-rc1.jar /home/chris/prj/android/android-app/target/scala-2.11/cache/android-app/global/proguard_cache/proguard-cache-7da24952ee22ce2189e8a1e9e937a8b7c38a7e9a.jar /home/chris/.ivy2/cache/com.fasterxml.jackson.module/jackson-module-scala_2.11/bundles/jackson-module-scala_2.11-2.4.0-rc1.jar /home/chris/prj/android/android-app/target/android-bin/classes.jar /home/chris/.ivy2/cache/org.springframework.android/spring-android-core/jars/spring-android-core-1.0.1.RELEASE.jar /home/chris/.ivy2/cache/com.google.code.findbugs/jsr305/jars/jsr305-2.0.1.jar /home/chris/.ivy2/cache/org.springframework.android/spring-android-rest-template/jars/spring-android-rest-template-1.0.1.RELEASE.jar /home/chris/.ivy2/cache/com.fasterxml.jackson.core/jackson-annotations/bundles/jackson-annotations-2.4.0-rc1.jar
Error Code:
    2
@longliveenduro

This comment has been minimized.

Show comment
Hide comment
@longliveenduro

longliveenduro May 8, 2014

Ah found the solution myself. Add this to your build.sbt:

// cache not only scala libs but also scaloid jar
proguardCache in Android += ProguardCache("org.scaloid") % "org.scaloid" %% "scaloid"

Ah found the solution myself. Add this to your build.sbt:

// cache not only scala libs but also scaloid jar
proguardCache in Android += ProguardCache("org.scaloid") % "org.scaloid" %% "scaloid"
@pocorall

This comment has been minimized.

Show comment
Hide comment
Owner

pocorall commented May 8, 2014

Yes, https://github.com/pocorall/hello-scaloid-sbt would be more helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment