Giter VIP home page Giter VIP logo

Comments (13)

saturday06 avatar saturday06 commented on June 30, 2024

https://github.com/Arneball/Android-Scala-Installer
https://github.com/Arneball/ScalaInstallerExample/

from gradle-android-scala-plugin.

Nutomic avatar Nutomic commented on June 30, 2024

I tried to add this with the following code in build.gradle:

android {
    buildTypes {
        debug {
            minifyEnabled true
            proguardFile file("proguard-rules.pro")
            dependencies {
                provided 'org.scala-lang:scala-library:2.11.4'
            }
        }
        release {
            minifyEnabled true
            proguardFile file("proguard-rules.pro")
            dependencies {
                compile 'org.scala-lang:scala-library:2.11.4'
            }
        }
    }
}

However, incremental debug build still takes about 1:30, same as when I used ony compile "scala...". Am I doing anything wrong?

from gradle-android-scala-plugin.

Arneball avatar Arneball commented on June 30, 2024

Don't minify in debug if possible.

from gradle-android-scala-plugin.

Nutomic avatar Nutomic commented on June 30, 2024

If I set minifyEnabled false, a clean build gives the following error after running almost 5 minutes:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
        at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)
        at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
        at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
        at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
        at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
        at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:302)
        at com.android.dx.command.dexer.Main.run(Main.java:245)
        at com.android.dx.command.dexer.Main.main(Main.java:214)
        at com.android.dx.command.Main.main(Main.java:106)

:app:dexDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
        /home/felix/software/android-sdk/build-tools/21.1.1/dx --dex --output /home/felix/workspace/ensichat/app/build/intermediates/dex/debug --input-list=/home/felix/workspace/ensichat/app/build/intermediates/tmp/dex/debug/libraryList.txt
  Error Code:
        2
  Output:

        UNEXPECTED TOP-LEVEL EXCEPTION:
        com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
                at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)
                at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
                at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
                at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
                at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
                at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
                at com.android.dx.command.dexer.Main.runMonoDex(Main.java:302)
                at com.android.dx.command.dexer.Main.run(Main.java:245)
                at com.android.dx.command.dexer.Main.main(Main.java:214)
                at com.android.dx.command.Main.main(Main.java:106)



* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

(in a small project with ~2000 lines of Scala and dependencies MessagePack and support v4)

from gradle-android-scala-plugin.

saturday06 avatar saturday06 commented on June 30, 2024

I think that build.gradle doesn't configure MultiDexApplication correctly. Since v1.1, the plugin requires MultiDexApplication. Please check https://github.com/saturday06/gradle-android-scala-plugin#5-setup-multidexapplication

from gradle-android-scala-plugin.

Nutomic avatar Nutomic commented on June 30, 2024

Okay I've added Multidex, but now incremental compile time has risen to over 2 minutes.

Here's my build.gradle, and I've also set <application android:name="android.support.multidex.MultiDexApplication"> in manifest.

Any idea what I'm doing wrong?

from gradle-android-scala-plugin.

saturday06 avatar saturday06 commented on June 30, 2024

I couldn't find something wrong in your build.gradle.
To find time consuming task, please upload gradlew --debug assembleDebug's result.

from gradle-android-scala-plugin.

Arneball avatar Arneball commented on June 30, 2024

Mine looks like this
http://pastebin.com/sZwLHX1G

from gradle-android-scala-plugin.

Nutomic avatar Nutomic commented on June 30, 2024

Here it is

Not sure why the time went down to 1:30 now, but obviously that's still too long.

from gradle-android-scala-plugin.

Arneball avatar Arneball commented on June 30, 2024

I've improved the example at https://github.com/Arneball/ScalaInstallerExample. I've included akka and made it work with proguard.
consecutive assembleDebug takes less than 20 seconds, given that libraries are predexed. Excellent gradle plugin. Big kudos.
I am still struggling with multidex builds. It seems there are some undocumented proguard runs that are configurable. I get a proguard crash however so i'll keep investigating.

from gradle-android-scala-plugin.

saturday06 avatar saturday06 commented on June 30, 2024

@Nutomic I checked your log. But the log was truncated and I couldn't find time wasting process.
pastebin might truncate your log. Please upload the log again. Or try @Arneball's preinstalled libs (recommended!).

from gradle-android-scala-plugin.

Nutomic avatar Nutomic commented on June 30, 2024

@Arneball I tried to apply your example to my project, but I couldn't quite figure out what I need to copy to my existing project. When I tried it, the clean build wasn't finished after ~5 minutes. I've pushed the code here.

@saturday06 Damn I didn't expect that. Here's the full log on Dropbox. I've also pushed the code here.

from gradle-android-scala-plugin.

Arneball avatar Arneball commented on June 30, 2024

Check pull request

2014-11-30 19:50 GMT+01:00 Felix Ableitner [email protected]:

@Arneball https://github.com/Arneball I tried to apply your example to
my project, but I couldn't quite figure out what I need to copy to my
existing project. When I tried it, the clean build wasn't finished after ~5
minutes. I've pushed the code here
https://github.com/Nutomic/ensichat/tree/scala-installer.

@saturday06 https://github.com/saturday06 Damn I didn't expect that. Here's
the full log on Dropbox
https://dl.dropboxusercontent.com/u/22457329/gradle-android-scala-plugin-issue-26.log.
I've also pushed the code here
https://github.com/Nutomic/ensichat/tree/multidex.


Reply to this email directly or view it on GitHub
#28 (comment)
.

from gradle-android-scala-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.