Note that there are some explanatory texts on larger screens.

plurals
  1. POEclipse, Android, Scala made easy but still does not work
    primarykey
    data
    text
    <p>I recently followed a way <a href="http://scala-forum.org/read.php?4,503,503#msg-503">of programming for Android using Scala and Eclipse</a>, which reduces the code and the compile time without using Proguard or Treeshake.</p> <p>Following this article, I should be able use the last Eclipse build (3.7), almost the last version of Scala (2.8.1) updated on an emulator version 10, the version 2.8.3 within Eclipse with the provided plug-in.</p> <p>The presented way is to provide a specific ramdisk image version, where we can upload scala libraries, which drastically shrinks the size of the code to upload to the emulator.</p> <p>I followed the steps, created a hello world, added scala nature, added a dummy scala class, moved the Scala builder before the Android Package Installer, everything builds perfectly, but when I launch the apk on a emulator from Eclipse, the application crashes and I get the following error, which looks like the <a href="http://lampwww.epfl.ch/~michelou/android/java-to-scala.html">same as presented here</a> (at the end of the document) :</p> <pre><code> 03-29 10:29:38.505: E/AndroidRuntime(839): java.lang.NoClassDefFoundError: upg.TestSinceInstallation.ComputeSum </code></pre> <p>If I remove the scala reference in the activity file, it runs well.</p> <p>Here is the TestSinceInstallation.java file:</p> <pre><code> package upg.TestSinceInstallation; import android.app.Activity; import android.os.Bundle; import upg.TestSinceInstallation.ComputeSum; public class TestSinceInstallationActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); int a = 1; int b = 5; ComputeSum cs = new ComputeSum(a, b); if(cs.getResut() == 6) { setContentView(R.layout.main); } } } </code></pre> <p>and here is the ComputeSum.scala file</p> <pre><code> package upg.TestSinceInstallation class ComputeSum(a: Int, b: Int) { def getResut() : Int = a + b } </code></pre> <p>What do you think I should do to make this work ? I feel so close to the goal.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload