Git Product home page Git Product logo

androidproguardscala's People

Contributors

banshee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidproguardscala's Issues

ant?

I realize that this is a bit OT, but can you give any tips on how to apply the proguard transformation from ant?

Developing in Eclipse is great, but I also need to be able to do CI, and afaict, I need the command-line tools to do that, thus ant.

You say: "The plugin is intended for development-time only. You should continue to use Proguard with your own configuration for release builds."

Can you give any hints what our own configuration should be?

I've tried (as a test) just copying the scala library to my project libs directory and enabling proguard. I get lots of unresolved references. I then tried copying the rest of the scala libraries and got lots more. So, obviously, I'm doing this wrong.

Keep predexed files

After dex runs, store a copy of the bin/dexedLibs/xxxx file so we can skip many dex runs too.

Scala library is not getting into the build

This seems to be #23 all over again.
I'm an Android n00b and have created a HelloWorld project and followed the instructions for getting Scala support into my project.  As in #23, upon running, the ScalaObject class cannot be found by the classloader.  I'm not sure if this is a bug report or a clueless n00b report, but here's the evidence that I have:

Proguard config file:
$ cat proguard_cache/proguard_processed.conf 
-injars "/home/eric/adt-bundle-linux-x86/eclipse/configuration/org.eclipse.osgi/bundles/347/1/.cp/lib/scala-library.jar"(!META-INF/MANIFEST.MF)
-injars "/home/eric/adt-bundle-linux-x86/eclipse/configuration/org.eclipse.osgi/bundles/347/1/.cp/lib/scala-swing.jar"(!META-INF/MANIFEST.MF)
-outjars "/home/eric/workspace/HelloWorld/proguard_cache/jartender_cache_7200869458962116516.jar"
-injars "/home/eric/workspace/HelloWorld/bin/classes"
-libraryjars "/home/eric/adt-bundle-linux-x86/sdk/platforms/android-17/android.jar"
-libraryjars "/home/eric/workspace/HelloWorld/libs/android-support-v4.jar"
-dontwarn
-dontoptimize
-dontobfuscate
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-ignorewarnings
-forceprocessing
-keep class com.ultracode.HelloWorld.R {*;}
-keep class com.ultracode.HelloWorld.R$menu {*;}
-keep class com.ultracode.HelloWorld.R$attr {*;}
-keep class com.ultracode.HelloWorld.R$id {*;}
-keep class com.ultracode.HelloWorld.R$string {*;}
-keep class com.ultracode.HelloWorld.BuildConfig {*;}
-keep class com.ultracode.HelloWorld.ScalaMainActivity {*;}
-keep class com.ultracode.HelloWorld.R$drawable {*;}
-keep class com.ultracode.HelloWorld.R$layout {*;}
-keep class com.ultracode.HelloWorld.R$style {*;}
=====

Running Proguard outside of Eclipse:
$ java -jar /home/eric/adt-bundle-linux-x86/sdk/tools/proguard/lib/proguard.jar @proguard_cache/proguard_processed.conf >/tmp/proguard.out

$ more /tmp/proguard.out 
ProGuard, version 4.7
Reading program jar [/home/eric/adt-bundle-linux-x86/eclipse/configuration/org.eclipse.osgi/bundles/347/1/.cp/lib/scal
a-library.jar] (filtered)
Reading program jar [/home/eric/adt-bundle-linux-x86/eclipse/configuration/org.eclipse.osgi/bundles/347/1/.cp/lib/scal
a-swing.jar] (filtered)
Reading program directory [/home/eric/workspace/HelloWorld/bin/classes]
Reading library jar [/home/eric/adt-bundle-linux-x86/sdk/platforms/android-17/android.jar]
Reading library jar [/home/eric/workspace/HelloWorld/libs/android-support-v4.jar]
Note: scala.xml.include.sax.Main$$anonfun$3 calls '(org.xml.sax.EntityResolver)Class.forName(variable).newInstance()'
Note: scala.Enumeration accesses a field 'MODULE$' dynamically
      Maybe this is program field 'scala.Array$ { scala.Array$ MODULE$; }'
      Maybe this is program field 'scala.Boolean$ { scala.Boolean$ MODULE$; }'
      Maybe this is program field 'scala.Byte$ { scala.Byte$ MODULE$; }'
      Maybe this is program field 'scala.Cell$ { scala.Cell$ MODULE$; }'
      Maybe this is program field 'scala.Char$ { scala.Char$ MODULE$; }'
[billions of entries like the above, then]
Note: there were 1 class casts of dynamically created class instances.
      You might consider explicitly keeping the mentioned classes and/or
      their implementations (using '-keep').
Note: there were 1 accesses to class members by means of introspection.
      You should consider explicitly keeping the mentioned class members
      (using '-keep' or '-keepclassmembers').
Note: You're ignoring all warnings!
Preparing output jar [/home/eric/workspace/HelloWorld/proguard_cache/jartender_cache_7200869458962116516.jar]
  Copying resources from program jar [/home/eric/adt-bundle-linux-x86/eclipse/configuration/org.eclipse.osgi/bundles/3
47/1/.cp/lib/scala-library.jar] (filtered)
  Copying resources from program jar [/home/eric/adt-bundle-linux-x86/eclipse/configuration/org.eclipse.osgi/bundles/3
47/1/.cp/lib/scala-swing.jar] (filtered)
==========

After a build from eclipse:
$ ls -l libs
total 400
-rw-r--r-- 1 eric eric 385685 Jan 22 18:44 android-support-v4.jar
-rw-r--r-- 1 eric eric    285 Feb  5 14:39 scala_library.min.jar
==========

$ jar tf ./proguard_cache/jartender_cache_7200869458962116516.jar 
library.properties
scala/swing/test/images/banana.jpg
scala/swing/test/images/margarita1.jpg
scala/swing/test/images/margarita2.jpg
scala/swing/test/images/rose.jpg
==========

Finally, the logcat output when trying to run the app:
02-05 22:50:37.227: W/Trace(602): Unexpected value from nativeGetEnabledTags: 0
02-05 22:50:37.227: I/dalvikvm(602): Failed resolving Lcom/ultracode/HelloWorld/ScalaMainActivity; interface 540 'Lscala/ScalaObject;'
02-05 22:50:37.247: W/dalvikvm(602): Link of class 'Lcom/ultracode/HelloWorld/ScalaMainActivity;' failed
02-05 22:50:37.267: D/AndroidRuntime(602): Shutting down VM
02-05 22:50:37.327: E/AndroidRuntime(602): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ultracode.HelloWorld/com.ultracode.HelloWorld.ScalaMainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.ultracode.HelloWorld.ScalaMainActivity" on path: /data/app/com.ultracode.HelloWorld-2.apk
===========

The "ScalaMainActivity" class file IS being generated.  Am I doing something wrong, or does there appear to be a problem here?

Eclipse not picking up the generated library

If I'm not mistaken, the Android build should use libs/scala_library.min.jar, right?

In my case, Eclipse detects it, AndroidProguardScala generates it correctly (as far as I could tell), but the Dex compiler doesn't pick it up. I tried cleaning the project and restarting Eclipse multiple times ; sometimes (rarely) it worked, but I wasn't able to identify what I did exactly.

Any idea about what I am doing wrong?

Running the proguard build on background

Would it be possible to run the proguard build on background rather than in the foreground as a modal window preventing editing for several seconds on save ?

android.util.Log.isLoggable method crashes application

I was compiling a sample version of the SyncAdapter using a AndroidProguardScala. The authentication service class had a standard if statement

if (Log.isLoggable(AccountAuthenticatorService.TAG, Log.VERBOSE)) {
  Log.v(AccountAuthenticatorService.TAG, 
      "AccountAuthenticatorService started")
}

If I remove the Log.isLoggable statement, the application runs correctly. Here's the relevant stack trace

I/ActivityManager( 1018): Start proc ca.cityhall.regina for service ca.cityhall.regina/.services.AccountAuthenticatorService: pid=2100 uid=10043 gids={1028}

I/Choreographer( 1272): Skipped 56 frames! The application may be doing too much work on its main thread.

E/Trace ( 2100): error opening trace file: No such file or directory (2)

I/dalvikvm( 2100): Could not find method scala.runtime.BoxesRunTime.boxToInteger, referenced from method ca.cityhall.regina.services.AccountAuthenticatorService.onBind

W/dalvikvm( 2100): VFY: unable to resolve static method 262: Lscala/runtime/BoxesRunTime;.boxToInteger (I)Ljava/lang/Integer;

D/dalvikvm( 2100): VFY: replacing opcode 0x71 at 0x0019

W/dalvikvm( 2100): VFY: unable to resolve static field 105 (UNIT) in Lscala/runtime/BoxedUnit;

D/dalvikvm( 2100): VFY: replacing opcode 0x62 at 0x0025

I/dalvikvm( 2100): Could not find method scala.runtime.BoxesRunTime.boxToInteger, referenced from method ca.cityhall.regina.services.AccountAuthenticatorService.onCreate

W/dalvikvm( 2100): VFY: unable to resolve static method 262: Lscala/runtime/BoxesRunTime;.boxToInteger (I)Ljava/lang/Integer;

D/dalvikvm( 2100): VFY: replacing opcode 0x71 at 0x0019

W/dalvikvm( 2100): VFY: unable to resolve static field 105 (UNIT) in Lscala/runtime/BoxedUnit;

D/dalvikvm( 2100): VFY: replacing opcode 0x62 at 0x0030

D/AndroidRuntime( 2100): Shutting down VM

W/dalvikvm( 2100): threadid=1: thread exiting with uncaught exception (group=0xb4ece288)

E/AndroidRuntime( 2100): FATAL EXCEPTION: main

E/AndroidRuntime( 2100): java.lang.NoClassDefFoundError: scala.runtime.BoxedUnit

E/AndroidRuntime( 2100): at ca.cityhall.regina.services.AccountAuthenticatorService.onCreate(AccountAuthenticatorService.scala:19)

E/AndroidRuntime( 2100): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2363)

E/AndroidRuntime( 2100): at android.app.ActivityThread.access$1600(ActivityThread.java:130)

E/AndroidRuntime( 2100): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)

E/AndroidRuntime( 2100): at android.os.Handler.dispatchMessage(Handler.java:99)

E/AndroidRuntime( 2100): at android.os.Looper.loop(Looper.java:137)

E/AndroidRuntime( 2100): at android.app.ActivityThread.main(ActivityThread.java:4745)

E/AndroidRuntime( 2100): at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 2100): at java.lang.reflect.Method.invoke(Method.java:511)

E/AndroidRuntime( 2100): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)

E/AndroidRuntime( 2100): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)

E/AndroidRuntime( 2100): at dalvik.system.NativeStart.main(Native Method)

android test projects?

Is AndroidProguardScala known to work with Android test projects?

Because I can't get it to work. :) When I try to launch the tests, the launch fails and logcat has:

E/AndroidRuntime(1470): java.lang.NoClassDefFoundError: scala/reflect/ScalaSignature

I do get a scala_library.min.jar, but it doesn't contain any classes. just library.properties.

If you care to look, I've created a git repo:

https://github.com/jimfulton/AndroidProguardScala-test-projects-example

with 3 projects:

hi
A scala android hello world app

hiTests
An attempt at an android test project written in scala, which doesn't launch

hiTestsJava
An android test project written in Java that launches and runs just fine.

Am I doing something wrong?

Add note to readme about needing scala nature + this plugin (was Scala Libraries not included, Cannot add Scala Nature)

I followed the Instructions in the README and successfully installed the plugin.
Then, I created a new Android Project 'ScalaTest' and successfully added the AndroidProguardScala Nature to it.

The README reads:
"Choose which jars in the classpath will be included in the minified jar. By default, the standard scala libraries will be included."
But these libraries are not added to the Android Project:
Bildschirmfoto 2013-01-25 um 07 59 52
Bildschirmfoto 2013-01-25 um 08 00 32

Moreover I cannot add the Scala Nature to it (no menu entry). Which may be another problem.
Bildschirmfoto 2013-01-25 um 08 01 38

The result is that I cannot add Scala classes to the project. The "Create a new Scala Class" wizard reports that "ScalaTest is not a Scala project" and refuses to add the class:
Bildschirmfoto 2013-01-25 um 07 58 51

After adding APS , Initial clean causes an error

Using Eclipse, I was just trying to augment an existing purely Java Android app by adding a simple Scala class that would provide some functionality.

  1. I clicked on the project to "Add AndroidProguardScala Nature" .
  2. Immediately afterwards, I wanted to issue a "clean" to make sure I was starting at a good state and I received this error

Errors occurred during the build.
Errors running builder 'Android Proguard Scala Builder' on project 'com.SerialTest.SerialTestActivity'.
java.lang.NullPointerException

I've tried this with several programs that I had written as well as some samples from the book Android Wireless Application Development Volume I

unable to update plugin

exception trace is listed below:

eclipse.buildId=M20120208-0800
java.version=1.6.0_33
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product -keyring /Users/walter/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/walter/.eclipse_keyring -showlocation

Error
Mon Jul 23 14:58:08 CST 2012
Unable to read repository at https://androidproguardscala.s3.amazonaws.com/UpdateSiteForAndroidProguardScala/content.xml.

java.net.SocketException: Operation timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:830)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:787)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.eclipse.ecf.provider.filetransfer.httpclient.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:227)
at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:69)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Use the new scala debugger

The new scala debugger helps to go through the code very easily:
http://scala-ide.org/docs/current-user-doc/features/scaladebugger/index.html

Could you activate it for your awesome plug-in AndroidProguardScala ? It currently works only for scala-only projects, so I guess it needs to be manually added.

Here is how they add their new debugger:
https://github.com/scala-ide/scala-ide/blob/eb61d7f4130cd1e0da95b6094abd70b68323f5dd/org.scala-ide.sdt.debug/plugin.xml

Thank you for your amazing work.

If you add an external jar, findMember fails

Errors occurred during the build.
Errors running builder 'Android Proguard Scala Builder' on project 'AkkaWithAndroid'.
findMember failed for /Users/james/src/akka-2.0/lib/akka/akka-actor-2.0.jar

Preference defaults aren't set until you visit the preferences page

Builder runs constantly without result (creates cache jars) and prints following error in logs:

!MESSAGE NonEmptyList(FailureWithException(executing Proguard,java.io.IOException: The output jar [.../jartender_cache_7188906568082531781.jar] must be specified after an input jar, or it will be empty.,None))

This happens if there is no jar set as 'Input Jar' in plugin properties

Never mind, Just figured that I should always set Scala library as 'Included' and then this error will never happen

NPE when figuring out a classname

java.lang.NullPointerException
at com.restphone.jartender.InternalName$.hashCode$extension(IdentifierFlavor.scala:12)
at com.restphone.jartender.InternalName.hashCode(IdentifierFlavor.scala:12)
at com.restphone.scalasubdir.scala.runtime.Statics.anyHash(Unknown Source)
at com.restphone.jartender.ProvidesClass.hashCode(ClassfileElement.scala:21)
at com.restphone.scalasubdir.scala.runtime.ScalaRunTime$.hash(ScalaRunTime.scala:214)
at com.restphone.scalasubdir.scala.collection.immutable.HashSet.elemHashCode(HashSet.scala:65)
at com.restphone.scalasubdir.scala.collection.immutable.HashSet.computeHash(HashSet.scala:74)
at com.restphone.scalasubdir.scala.collection.immutable.HashSet.$plus(HashSet.scala:56)
at com.restphone.scalasubdir.scala.collection.immutable.HashSet.$plus(HashSet.scala:33)
at com.restphone.scalasubdir.scala.collection.mutable.SetBuilder.$plus$eq(SetBuilder.scala:24)
at com.restphone.scalasubdir.scala.collection.mutable.SetBuilder.$plus$eq(SetBuilder.scala:22)
at com.restphone.scalasubdir.scala.collection.generic.Growable$$anonfun$$plus$plus$eq$1.apply(Growable.scala:48)
at com.restphone.scalasubdir.scala.collection.generic.Growable$$anonfun$$plus$plus$eq$1.apply(Growable.scala:48)
at com.restphone.scalasubdir.scala.collection.immutable.List.foreach(List.scala:309)
at com.restphone.scalasubdir.scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
at com.restphone.scalasubdir.scala.collection.mutable.SetBuilder.$plus$plus$eq(SetBuilder.scala:22)
at com.restphone.scalasubdir.scala.collection.TraversableLike$class.to(TraversableLike.scala:629)
at com.restphone.scalasubdir.scala.collection.AbstractTraversable.to(Traversable.scala:105)
at com.restphone.scalasubdir.scala.collection.TraversableOnce$class.toSet(TraversableOnce.scala:253)
at com.restphone.scalasubdir.scala.collection.AbstractTraversable.toSet(Traversable.scala:105)
at com.restphone.jartender.CacheSystem$$anonfun$buildUsersAndProviders$1.apply(CacheSystem.scala:72)
at com.restphone.jartender.CacheSystem$$anonfun$buildUsersAndProviders$1.apply(CacheSystem.scala:69)
at scalaz.Apply$$anonfun$apply3$2.apply(Apply.scala:65)
at scalaz.Apply$$anonfun$apply3$2.apply(Apply.scala:65)
at com.restphone.scalasubdir.scala.Function2$$anonfun$curried$1$$anonfun$apply$1.apply(Function2.scala:45)
at scalaz.Validation$class.ap(Validation.scala:128)
at scalaz.Success.ap(Validation.scala:315)
at scalaz.ValidationInstances3$$anon$2.ap(Validation.scala:426)
at scalaz.ValidationInstances3$$anon$2.ap(Validation.scala:421)
at scalaz.Apply$class.ap2(Apply.scala:36)
at scalaz.ValidationInstances3$$anon$2.ap2(Validation.scala:421)
at scalaz.Applicative$class.apply2(Applicative.scala:28)
at scalaz.ValidationInstances3$$anon$2.apply2(Validation.scala:421)
at scalaz.Apply$class.apply3(Apply.scala:65)
at scalaz.ValidationInstances3$$anon$2.apply3(Validation.scala:421)
at scalaz.syntax.ApplicativeBuilder$ApplicativeBuilder3$class.apply(ApplicativeBuilder.scala:22)
at scalaz.syntax.ApplicativeBuilder$$anon$1.apply(ApplicativeBuilder.scala:13)
at com.restphone.jartender.CacheSystem.buildUsersAndProviders(CacheSystem.scala:68)
at com.restphone.jartender.CacheSystem.findInCache(CacheSystem.scala:59)
at com.restphone.jartender.CacheSystem.execute(CacheSystem.scala:35)
at com.restphone.androidproguardscala.AndroidProguardScalaBuilder$$anonfun$7.apply(AndroidProguardScalaBuilder.scala:100)
at com.restphone.androidproguardscala.AndroidProguardScalaBuilder$$anonfun$7.apply(AndroidProguardScalaBuilder.scala:97)
at scalaz.Validation$class.flatMap(Validation.scala:137)
at scalaz.Success.flatMap(Validation.scala:315)
at com.restphone.androidproguardscala.AndroidProguardScalaBuilder.build(AndroidProguardScalaBuilder.scala:97)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:422)
at org.eclipse.ui.actions.GlobalBuildAction$1.run(GlobalBuildAction.java:180)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Not catching a proguard error with duplicate libraries

Warning: can't write resource [reflect.properties](Duplicate zip entry [scala-reflect-2.10.1.jar:reflect.properties])
Error: Can't write [C:\Users\james\workspace\AkkaProducerConsumerBenchmarks\proguard_cache\jartender_cache_3033257530503124243.jar](Can't read [C:Usersjames.ivy2cacheorg.scala-langscala-reflectjarsscala-reflect-2.10.1.jar%28;;;;!META-INF/MANIFEST.MF%29] %28Duplicate zip entry [scala-reflect-2.10.1.jar:scala/reflect/api/Annotations$ArrayArgumentExtractor.class]%29)

StringBuilder

I get a java.lang.NoClassDefFoundError: scala.collection.mutable.StringBuilder

based on a straightforward ....

val textViewCounter = findViewById(R.id.textViewCounter).asInstanceOf[TextView]
textViewCounter.setText("This app has been started " + counter + " times.");

I am running Eclipse Juno + Scala 2.10.1 + Android 4.1.2 + AndroidProguardScala 47.2...

I have tried adding the following to proguard_cache_conf/proguard_additions.conf...

-keep class scala.collection.mutable.StringBuilder { *; }

Any ideas?

Need real build system

Right now it's handbuilt with paths specific to a single machine. That's obviously not good.

"type ScalaObject is not a member of package scala"

Hi.

Great work on this plugin, it's the first solution that actually seems to work somewhat for scala on android.

However, I'm getting some errors from the presentation compiler like the one mentioned in the title, another that comes to mind is that object List does not have an apply method.

I'm guessing that the presentation compiler sometimes uses scala-library.min and sometimes the full scala library or something like that?
Seeing the same problem?

# scala-library.jar was calculated from the classpath -injars "C:/cygwin/home/james/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application with Equinox Weaving/org.eclipse.osgi/bundles/951/1/.cp/lib/scala-library.jar"(!META-INF/MANIFEST.MF)

Duplicate injar entries:

scala-library.jar was calculated from the classpath

-injars "C:/cygwin/home/james/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application with Equinox Weaving/org.eclipse.osgi/bundles/951/1/.cp/lib/scala-library.jar"(!META-INF/MANIFEST.MF)

The CKSUM string is significant - it will be replaced with an actual checksum

-outjar "C:\cygwin\home\james\runtime-EclipseApplicationwithEquinoxWeaving\SomeTest\proguard_cache\scala-library.CKSUM.jar"
-injar "C:\cygwin\home\james\runtime-EclipseApplicationwithEquinoxWeaving\SomeTest\bin\classes"
-injar "C:\cygwin\home\james\runtime-EclipseApplicationwithEquinoxWeaving\SomeTest\bin\classes"

Android library calculated from classpath

-libraryjars "C:/cygwin/home/james/lib/android-sdk-windows/platforms/android-8/android.jar"

Builtin defaults

-keep public class * extends android.**
-dontwarn *$$anonfun$
-dontwarn
-dontoptimize
-dontobfuscate
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers

-ignorewarnings

-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
SourceFile,LineNumberTable,Annotation,EnclosingMethod

-keep public class scala.ScalaObject
-keep public class scala.Function0, scala.Function1

Inserting file C:\cygwin\home\james\runtime-EclipseApplicationwithEquinoxWeaving\SomeTest\proguard_cache_conf\proguard_additions.conf - possibly empty

Why do I need a ProGuard run on every build?

I have a general question about this plugin. Readme file tells me:
"Scala + Android requires a Proguard run on every build."

Why is it required? Pure Android + Java development does not need ProGuard at all.

Failed resolving interface 540 'Lscala/ScalaObject;'

I did everything exactly like mentioned in your README and I want to deploy a "Hello world" app on an Android device. With pure Java, no problem, with Scala nature and AndroidProguard Nature, I get the error

dalvikvm: Failed resolving Lde/meintest/helloworld/MainActivity; interface 540 'Lscala/ScalaObject;'
dalvikvm: Link of class 'Lde/meintest/helloworld/MainActivity;' failed
AndroidRuntime: Shutting down VM
[...]

It seems that the ScalaObject is not included into the apk file?
I only found this in MainActivity.smali

.class public Lde/meintest/helloworld/MainActivity;
.super Landroid/app/Activity;
.source "MainActivity.scala"

# interfaces
.implements Lscala/ScalaObject;

I found this topic on stackoverflow (Netbeans, but the same error):
http://stackoverflow.com/questions/2626471/grafting-scala-2-8-into-a-netbeans-nbandroid-project-what-steps-am-i-missing
with one possible solution:

I had the same problem and finally found the solution:)

In my case, I was not changing the value of property out.dex.input.absolute.dir (in SDK Tools r8) to jar file that was generated by Proguard. So, the ScalaObject interface was really not present in apk file.

(I discovered that using great apktool.)

So is this an AndroidProguardScala or Proguard problem?

Error running builder 'Android Proguard Scala Builder'

When compiling the basic scala-android project (as shown on the Scala IDE tutorial) Eclipse throws the following error

Errors running builder 'Android Proguard Scala Builder' on project 'HelloScala'.

Eclipse stack trace:

org.jruby.exceptions.RaiseException: (TypeError) can't convert nil into String
at org.jruby.RubyFile.unlink(org/jruby/RubyFile.java:1785)
at ProguardCacheRuby.install_proguard_output(classpath:/./proguard_cache.rb:61)
at ProguardCacheJavaInterop.install_proguard_output(src/main/jruby/proguard_cache_java_interop.rb:20)

  • Added Scala nature and Android ProGuard nature
  • Im still able to run the app, but it doesn't found the main activity class

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.