Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8528057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:43:03+00:00 2026-06-11T08:43:03+00:00

I tried using sbt and maven for android-scala and I quite like maven for

  • 0

I tried using sbt and maven for android-scala and I quite like maven for doing the whole release thing(ProGuard-ing the scala standar lib etc). But I want lightweight recompile cycle for development inside my IDE – IntelliJ IDEA.

The problem is scala files wont’t compile. I configured my project like this:

  • created android project
  • added scala facet
  • set scala compiler to global
  • added dependency on scala library(global) and set it to “provided”

I added a scala object and referenced it from java Activity. ClassNotFoundException and force close. It compiles cleanly(and quite quckly).

I created a plain old java project the same way and using same global libraries and it worked.
An inspection of the apk revealed it contained scala source(!) file. So apparently it didn’t event try to compile.

Oh, and my phone has scala preinstalled with scala installer from play store.

I use IntelliJ IDEA 11 community. I first tried this a few months ago and it worked.

update it works on a different machine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:43:04+00:00Added an answer on June 11, 2026 at 8:43 am

    You might have to fiddle with your “proguard.cfg” file.

    Here’s the one I use from a project using Scala 2.10 and Android with the IntelliJ IDE (change the first option to match your package name):

    ##
    ## Keep classes of named package
    ##
    -keep public class **.keithpinson.**
    ## ## ## ## ## ## ## ## ## ## ## ## ##
    
    
    ##
    ## RELEASE ONLY
    ##
    ##-optimizationpasses 3
    ##-overloadaggressively
    ##-repackageclasses ''
    ##-allowaccessmodification
    ##-optimizations !code/simplification/arithmetic
    ##         ,!field/*,!class/merging/*,!code/allocation/variable
    ##-keepattributes *Annotation*
    
    ##
    ## DEBUG ONLY
    ##
    -dontobfuscate
    -dontoptimize
    -keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
    ## -printmapping mapping.txt
    
    
    ##
    ## ALL VERSIONS
    ##
    -dontpreverify
    -dontskipnonpubliclibraryclasses
    -dontskipnonpubliclibraryclassmembers
    -dontusemixedcaseclassnames
    
    
    ## Keep Limited Serializable Capability
    ##-keepclassmembers class * implements java.io.Serializable {
    ##    static long serialVersionUID;
    ##    private void writeObject(java.io.ObjectOutputStream);
    ##    private void readObject(java.io.ObjectInputStream);
    ##    java.lang.Object writeReplace();
    ##    java.lang.Object readResolve();
    ##}
    
    ## Keep All Serializable Capability
    ##-keep class * implements java.io.Serializable { *; }"
    
    
    
    
    
    ##
    ## ANDROID SETTINGS
    ##
    -dontwarn com.google.common.collect.MinMaxPriorityQueue
    -dontwarn com.google.common.primitives.UnsignedBytes$*
    
    -dontnote android.app.backup.BackupAgentHelper
    -dontnote com.android.vending.licensing.ILicensingService
    
    -keep public class * extends android.app.Activity
    -keep public class * extends android.app.Application
    -keep public class * extends android.app.Service
    -keep public class * extends android.content.BroadcastReceiver
    -keep public class * extends android.content.ContentProvider
    -keep public class * extends android.app.backup.BackupAgentHelper
    -keep public class * extends android.preference.Preference
    -keep public class com.android.vending.licensing.ILicensingService
    
    -keepclasseswithmembernames class * {
        native <methods>;
    }
    
    -keep public class * extends android.view.View {
        public <init>(android.content.Context);
        public <init>(android.content.Context, android.util.AttributeSet);
        public <init>(android.content.Context, android.util.AttributeSet, int);
        public void set*(...);
    }
    
    -keepclasseswithmembers class * {
        public <init>(android.content.Context, android.util.AttributeSet);
    }
    
    -keepclasseswithmembers class * {
        public <init>(android.content.Context, android.util.AttributeSet, int);
    }
    
    -keepclassmembers class * extends android.app.Activity {
       public void *(android.view.View);
    }
    
    -keepclassmembers enum * {
        public static **[] values();
        public static ** valueOf(java.lang.String);
    }
    
    -keep class * implements android.os.Parcelable {
      public static final android.os.Parcelable$Creator *;
    }
    
    # R classes may be built out of sequence so don't proguard them
    -keep public class **.R { *; }
    -keepclassmembers class **.R$* {
        public static <fields>;
    }
    
    # Removes all calls to Log. Delete the methods you want to keep.
    -assumenosideeffects class android.util.Log {
        public static int v(...);
        #public static int d(...);
        public static int i(...);
        #public static int w(...);
        #public static int e(...);
        #public static int wtf(...);
    }
    
    ## Fixes ==> Warning: ... can't find referenced class javax.xml.stream.events.XMLEvent
    ## -dontwarn javax.xml.**
    
    
    ## If using Guice
    ## -keep class com.google.common.base.Finalizable* {
    ##   <fields>;
    ##   <methods>;
    ## }
    ##
    ## -keep class com.google.common.base.internal.Finalizer {
    ##   <fields>;
    ##   <methods>;
    ## }
    
    
    ##
    ## SCALA SETTINGS
    ##
    -dontwarn **$$anonfun$*
    -dontwarn scala.android.**
    -dontwarn scala.beans.ScalaBeanInfo
    -dontwarn scala.collection.generic.GenTraversableFactory
    -dontwarn scala.collection.immutable.RedBlack$Empty
    -dontwarn scala.concurrent.forkjoin.**
    -dontwarn scala.reflect.**
    -dontwarn scala.sys.process.**
    -dontwarn scala.tools.**,plugintemplate.**
    
    
    #(org.xml.sax.EntityResolver)Class.forName(variable).newInstance()
    -dontnote org.xml.sax.EntityResolver
    
    #(org.apache.james.mime4j.storage.StorageProvider)Class.forName(variable).newInstance()
    -dontnote org.apache.james.mime4j.storage.DefaultStorageProvider
    
    -dontnote scala.android.app.Activity
    
    
    ## Keep All Scala Classes
    ##-keep class scala.** { *; }
    
    -keep class scala.android.package**
    -keep class * extends scala.android.app.Activity
    
    ## Fixes ==> Warning: ... can't find referenced class sun.misc.Unsafe
    -libraryjars libs/jsr305-2.0.1.jar
    -dontwarn sun.misc.Unsafe
    
    
    -keep class * extends scala.runtime.MethodCache {
        public <methods>;
    }
    
    -keepclassmembers class * {
        ** MODULE$;
    }
    
    -keepclassmembernames class scala.concurrent.forkjoin.ForkJoinPool {
        long eventCount;
        int workerCounts;
        int runControl;
        scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode syncStack;
        scala.concurrent.forkjoin.ForkJoinPool$WaitQueueNode spareStack;
    }
    
    -keepclassmembernames class scala.concurrent.forkjoin.ForkJoinWorkerThread {
        int base;
        int sp;
        int runState;
    }
    
    -keepclassmembernames class scala.concurrent.forkjoin.ForkJoinTask {
        int status;
    }
    
    -keepclassmembernames class scala.concurrent.forkjoin.LinkedTransferQueue {
        scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference head;
        scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference tail;
        scala.concurrent.forkjoin.LinkedTransferQueue$PaddedAtomicReference cleanMe;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem with developing in Scala on Android. I'm using sbt
Before I had something like this (simplified), using sbt 0.11.3: // project/Build.scala import sbt._
I'm using sbt 0.11.3 (also tried on 0.11.2), and scala 2.9.1.Final. I have a
I am trying to import Scalala into Eclipse. I had tried using the sbt-eclipse
I have a fairly normal Scala project currently being built using Maven. I would
I am new and had built some simple Scala applications / tutorials using SBT.
I tried using ActiveResource to parse a web service that was more like a
I'm using SBT v0.13 with jberkel/android-plugin, which I am trying to modify. In order
I just installed SBT 0.10.1. I'm using Lift 2.4-M3 I can build with Scala
I have tried ensime/sbt on mac os. First, I open the .scala file in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.