Skip to content
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

android test projects? #34

Closed
jimfulton opened this issue Feb 3, 2013 · 7 comments
Closed

android test projects? #34

jimfulton opened this issue Feb 3, 2013 · 7 comments

Comments

@jimfulton
Copy link

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?

@banshee
Copy link
Owner

banshee commented Feb 3, 2013

It doesn't look like those projects have AndroidProguardScala nature;
there's no proguard_conf directory (or did you just not check that in?)

What does the proguard_processed.conf file look like?

@banshee
Copy link
Owner

banshee commented Feb 3, 2013

FYI, I'm starting to add to the troubleshooting section of
https://github.com/banshee/AndroidProguardScala/blob/master/README.md

On Sun, Feb 3, 2013 at 12:41 PM, James Moore banshee@banshee.com wrote:

It doesn't look like those projects have AndroidProguardScala nature;
there's no proguard_conf directory (or did you just not check that in?)

What does the proguard_processed.conf file look like?

James Moore
james@restphone.com
http://jamesmoorecode.blogspot.com/

@jimfulton
Copy link
Author

On Sun, Feb 3, 2013 at 3:42 PM, James Moore notifications@github.com wrote:

It doesn't look like those projects have AndroidProguardScala nature;

The nature is listed in hi/.project and hiTest/.project

there's no proguard_conf directory (or did you just not check that in?)

I've never seen such a thing.

I do have proguard_cache and proguard_cache_conf directories, which I
assumed I shouldn't check in.

What does the proguard_processed.conf file look like?

like this:

-injars "/Users/jim/i/android/eclipse/configuration/org.eclipse.osgi/bundles/479/1/.cp/lib/scala-library.jar"(!META-INF/MANIFEST.MF)
-injars "/Users/jim/i/android/eclipse/configuration/org.eclipse.osgi/bundles/479/1/.cp/lib/scala-swing.jar"(!META-INF/MANIFEST.MF)
-injars "/Users/jim/i/android/eclipse/configuration/org.eclipse.osgi/bundles/479/1/.cp/lib/scala-actors.jar"(!META-INF/MANIFEST.MF)
-outjars "/Users/jim/e/hi/proguard_cache/jartender_cache_6342811044649977578.jar"
-injars "/Users/jim/e/hi/bin/classes"
-libraryjars "/Users/jim/i/android/sdk/platforms/android-4.2/android.jar"
-libraryjars "/Users/jim/e/hi/libs/android-support-v4.jar"
-dontwarn
-dontoptimize
-dontobfuscate
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers

-ignorewarnings
-forceprocessing

# Inserting proguard additions file

/Users/jim/e/hi/proguard_cache_conf/proguard_additions.conf here
# /Users/jim/e/hi/proguard_cache_conf/proguard_additions.conf (No
such file or directory)
-keep class com.zope.hi.BuildConfig {;}
-keep class com.zope.hi.MainActivity {
;}
-keep class com.zope.hi.R$attr {;}
-keep class com.zope.hi.R$drawable {
;}
-keep class com.zope.hi.R$id {;}
-keep class com.zope.hi.R$layout {
;}
-keep class com.zope.hi.R$menu {;}
-keep class com.zope.hi.R$string {
;}
-keep class com.zope.hi.R$style {;}
-keep class com.zope.hi.R {
;}

So it looks like there's a missing -injars for the test project.

Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://zo.pe/Kqm

@banshee
Copy link
Owner

banshee commented Feb 3, 2013

What Scala ide version are you using?
On Feb 3, 2013 1:02 PM, "Jim Fulton" notifications@github.com wrote:

On Sun, Feb 3, 2013 at 3:42 PM, James Moore notifications@github.com
wrote:

It doesn't look like those projects have AndroidProguardScala nature;

The nature is listed in hi/.project and hiTest/.project

there's no proguard_conf directory (or did you just not check that in?)

I've never seen such a thing.

I do have proguard_cache and proguard_cache_conf directories, which I
assumed I shouldn't check in.

What does the proguard_processed.conf file look like?

like this:

-injars
"/Users/jim/i/android/eclipse/configuration/org.eclipse.osgi/bundles/479/1/.cp/lib/scala-library.jar"(!META-INF/MANIFEST.MF)
-injars
"/Users/jim/i/android/eclipse/configuration/org.eclipse.osgi/bundles/479/1/.cp/lib/scala-swing.jar"(!META-INF/MANIFEST.MF)
-injars
"/Users/jim/i/android/eclipse/configuration/org.eclipse.osgi/bundles/479/1/.cp/lib/scala-actors.jar"(!META-INF/MANIFEST.MF)
-outjars
"/Users/jim/e/hi/proguard_cache/jartender_cache_6342811044649977578.jar"
-injars "/Users/jim/e/hi/bin/classes"
-libraryjars "/Users/jim/i/android/sdk/platforms/android-4.2/android.jar"
-libraryjars "/Users/jim/e/hi/libs/android-support-v4.jar"
-dontwarn
-dontoptimize
-dontobfuscate
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers

-ignorewarnings
-forceprocessing

Inserting proguard additions file

/Users/jim/e/hi/proguard_cache_conf/proguard_additions.conf here

/Users/jim/e/hi/proguard_cache_conf/proguard_additions.conf (No

such file or directory)
-keep class com.zope.hi.BuildConfig {;}
-keep class com.zope.hi.MainActivity {
;}
-keep class com.zope.hi.R$attr {;}
-keep class com.zope.hi.R$drawable {
;}
-keep class com.zope.hi.R$id {;}
-keep class com.zope.hi.R$layout {
;}
-keep class com.zope.hi.R$menu {;}
-keep class com.zope.hi.R$string {
;}
-keep class com.zope.hi.R$style {;}
-keep class com.zope.hi.R {
;}

So it looks like there's a missing -injars for the test project.

Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://zo.pe/Kqm


Reply to this email directly or view it on GitHubhttps://github.com//issues/34#issuecomment-13054228.

@jimfulton
Copy link
Author

On Sun, Feb 3, 2013 at 4:02 PM, Jim Fulton jim@zope.com wrote:

On Sun, Feb 3, 2013 at 3:42 PM, James Moore notifications@github.com wrote:

What does the proguard_processed.conf file look like?

like this:

Sorry, I think I sent the wrong one. It look like this:

-injars "/Users/jim/i/android/eclipse/configuration/org.eclipse.osgi/bundles/479/1/.cp/lib/scala-library.jar"(!META-INF/MANIFEST.MF)
-injars "/Users/jim/i/android/eclipse/configuration/org.eclipse.osgi/bundles/479/1/.cp/lib/scala-swing.jar"(!META-INF/MANIFEST.MF)
-injars "/Users/jim/i/android/eclipse/configuration/org.eclipse.osgi/bundles/479/1/.cp/lib/scala-actors.jar"(!META-INF/MANIFEST.MF)
-outjars "/Users/jim/e/hiTests/proguard_cache/jartender_cache_2142014402002217566.jar"
-injars "/Users/jim/e/hiTests/bin/classes"
-libraryjars "/Users/jim/i/android/sdk/platforms/android-4.2/android.jar"
-dontwarn
-dontoptimize
-dontobfuscate
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers

-ignorewarnings
-forceprocessing

Inserting proguard additions file

/Users/jim/e/hiTests/proguard_cache_conf/proguard_additions.conf here

/Users/jim/e/hiTests/proguard_cache_conf/proguard_additions.conf (No

such file or directory)
-keep class com.zope.hi.test.BuildConfig {;}
-keep class com.zope.hi.test.MainActivityTest {
;}
-keep class com.zope.hi.test.R$attr {;}
-keep class com.zope.hi.test.R$drawable {
;}
-keep class com.zope.hi.test.R$string {;}
-keep class com.zope.hi.test.R {
;}

So it does have the test class directory.

I noticed in the AndroidProguardScala properties that the
scala-reflect jar was being ignored.

Give that the error I'm getting is:

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

That seemed relevant, but even after setting scala-reflect to be an
input jar, I'm still getting the error.

Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://zo.pe/Kqm

@jimfulton
Copy link
Author

On Sun, Feb 3, 2013 at 4:19 PM, James Moore notifications@github.comwrote:

What Scala ide version are you using?

2.1.0 nightly 2_10 from Jan 24.

I couldn't get a non nightly release to work.

scala-ide/docs#39

Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://zo.pe/Kqm

@jimfulton
Copy link
Author

Removing the AndroidProguardScala nature and putting the scala library in by libs directory worked.

So then... Added proguard_cache_conf/proguard_additions.conf with:

-keep class scala.reflect.ScalaSignature

removed proguard_cache and success!

So, maybe AndroidProguardScala should add that for test projects?

I guess I should check proguard_cache_conf in?

The README's description of proguard_cache and proguard_cache_conf don't seem to match what I'm seeing.
My proguard_cache_conf is empty except for proguard_additions.conf. proguard_processed.conf is in proguard_cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants