- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Can't compile Scala for Android SDK Tools, revision 7
Fri, 2010-09-10, 09:24
He,
I am entirely new to Scala@Android but with the help of
https://www.assembla.com/wiki/show/scala-ide/Developing_for_Android
I managed to get Scala running on Android.
This morning I updated to Android SDK Tools, revision 7, and now nothing is working any longer :(
Initiating ``ant install'' gives me the below listed output. Even modifying the ant script with respect to the warnings still gives me this NPE.
Any help is highly appreciated cause I have to finish a project and want to promote Scala … I really don't wanna switch back to Java … Please help!!!!
--------------------------------------------------------------------------------------------------------------------------------
$ ant install
Buildfile: /Users/mun/Projects/I4A/build.xml
Android SDK Tools Revision 7
Project Target: Android 2.2
API level: 8
------------------
Resolving library dependencies:
------------------
Ordered libraries:
------------------
-compile-tested-if-test:
-dirs:
Creating output directories if needed...
-resource-src:
Generating R.java / Manifest.java from the resources...
-aidl:
Compiling aidl files into Java classes...
compile:
/Users/mun/Projects/I4A/build.xml:214: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Compiling 1 source file to /Users/mun/Projects/I4A/bin/classes
Compiling 1 scala and 1 java source files to /Users/mun/Projects/I4A/bin/classes
Compiling 0 scala and 1 java source files to /Users/mun/Projects/I4A/bin/classes
proguard:
ProGuard, version 4.5.1
Reading program directory [/Users/mun/Projects/I4A/bin/classes]
Reading program jar [/Users/mun/Projects/I4A/libs/tiua-0.0.1.jar]
Reading program jar [/Users/mun/Projects/I4A/tools/scala-library.jar] (filtered)
Reading library jar [/Users/mun/lib/android-sdk-mac_86/platforms/android-8/android.jar]
Note: scala.xml.include.sax.Main$$anonfun$3 calls '(org.xml.sax.EntityResolver)Class.forName(variable).newInstance()'
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: You're ignoring all warnings!
Preparing output jar [/Users/mun/Projects/I4A/bin/classes.min.jar]
Copying resources from program directory [/Users/mun/Projects/I4A/bin/classes]
Copying resources from program jar [/Users/mun/Projects/I4A/libs/tiua-0.0.1.jar]
Copying resources from program jar [/Users/mun/Projects/I4A/tools/scala-library.jar] (filtered)
-dex:
Converting compiled files and external libraries into /Users/mun/Projects/I4A/bin/classes.dex...
-package-resources:
Packaging resources
WARNNG: Using deprecated 'resources' attribute in AaptExecLoopTask.Use nested element(s) instead.
WARNNG: Using deprecated 'outfolder' attribute in AaptExecLoopTask.Use 'apkfolder' (path) instead.
WARNNG: Using deprecated 'basename' attribute in AaptExecLoopTask.Use 'resourcefilename' (string) instead.
Creating full resource package...
-package-debug-sign:
WARNING: Using deprecated 'basename' attribute in ApkBuilderTask.Use 'apkfilepath' (path) instead.
WARNING: Using deprecated inner element in ApkBuilderTask.Use instead.
BUILD FAILED
/Users/mun/Projects/I4A/build.xml:264: The following error occurred while executing this line:
/Users/mun/Projects/I4A/build.xml:120: java.lang.NullPointerException
at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:239)
[snip]
--------------------------------------------------------------------------------------------------------------------------------
Fri, 2010-09-10, 10:07
#2
Re: Can't compile Scala for Android SDK Tools, revision 7
On Sep 10, 2010, at 10:38 AM, Miles Sabin wrote:
> On Fri, Sep 10, 2010 at 9:24 AM, Normen Müller
> wrote:
>> @Miles: Sorry for asking you directly (!!!) but I really need some help and I guess you are one of the persons who could help :-\
>
> That NPE is coming out of an Android ant task, so it's pretty much
> independent of the Scala IDE ... presumably you could reproduce it on
> the command line completely separately from Eclipse. If that's not the
> case, then please let me know.
>
> I'm afraid I really don't have any insight into this: you need to talk
> to someone who's actively using Scala on Android ... there should be
> quite a few people here who are.
Alright, will do so. I am also not used it, though :(
Just one more questions: are there any improvements/ planes wrt. Scala IDE and developing for Android?
/nm
P.S. Thanks for your reply!
Fri, 2010-09-10, 10:17
#3
Re: Can't compile Scala for Android SDK Tools, revision 7
On Fri, Sep 10, 2010 at 10:03 AM, Normen Müller
wrote:
> Just one more questions: are there any improvements/ planes wrt. Scala IDE and developing for Android?
I think the consensus was that the main thing we need is some form of
cooperation between the Android builder, the Scala builder and
Proguard. It's doable, but I don't think there's anyone working on it
at the moment. Kevin?
Cheers,
Miles
Fri, 2010-09-10, 10:27
#4
Re: Re: Can't compile Scala for Android SDK Tools, revision 7
I'm just using the ant builder retrofitted to use scala + proguard, and bypassing the eclipse builder entirely.
You can follow my instructions here:http://www.assembla.com/wiki/show/scala-ide/Developing_for_Android
but instead of downloading the ant patch, manually follow the steps described to the newer ant version from rev 7
On 10 September 2010 10:07, Miles Sabin <miles@milessabin.com> wrote:
--
Kevin Wright
mail / gtalk / msn : kev.lee.wright@gmail.com
pulse / skype: kev.lee.wright
twitter: @thecoda
You can follow my instructions here:http://www.assembla.com/wiki/show/scala-ide/Developing_for_Android
but instead of downloading the ant patch, manually follow the steps described to the newer ant version from rev 7
On 10 September 2010 10:07, Miles Sabin <miles@milessabin.com> wrote:
On Fri, Sep 10, 2010 at 10:03 AM, Normen Müller
<normen.mueller@googlemail.com> wrote:
> Just one more questions: are there any improvements/ planes wrt. Scala IDE and developing for Android?
I think the consensus was that the main thing we need is some form of
cooperation between the Android builder, the Scala builder and
Proguard. It's doable, but I don't think there's anyone working on it
at the moment. Kevin?
Cheers,
Miles
--
Miles Sabin
tel: +44 7813 944 528
gtalk: miles@milessabin.com
skype: milessabin
http://www.chuusai.com/
http://twitter.com/milessabin
--
Kevin Wright
mail / gtalk / msn : kev.lee.wright@gmail.com
pulse / skype: kev.lee.wright
twitter: @thecoda
Fri, 2010-09-10, 10:47
#5
Re: Re: Can't compile Scala for Android SDK Tools, revision 7
On Sep 10, 2010, at 11:14 AM, Kevin Wright wrote:
> I'm just using the ant builder retrofitted to use scala + proguard, and bypassing the eclipse builder entirely.
>
> You can follow my instructions here:
> http://www.assembla.com/wiki/show/scala-ide/Developing_for_Android
>
> but instead of downloading the ant patch, manually follow the steps described to the newer ant version from rev 7
This page is my main source for getting Scala running at Android. Thank you very much for these instructions!!
However, I can't see the description for revision 7 :(
BTW, just to make sure: With ``rev 7'' you are referring to SDK tools downloadable at
http://developer.android.com/sdk/index.html
Cause this is the SDK I am using with Platform 2.2.
I would highly appreciate if you could please help me further… I really want to use Scala on Android and I am willing to contribute in any way: testing, documenting, …
>
>
>
> On 10 September 2010 10:07, Miles Sabin wrote:
> On Fri, Sep 10, 2010 at 10:03 AM, Normen Müller
> wrote:
> > Just one more questions: are there any improvements/ planes wrt. Scala IDE and developing for Android?
>
> I think the consensus was that the main thing we need is some form of
> cooperation between the Android builder, the Scala builder and
> Proguard. It's doable, but I don't think there's anyone working on it
> at the moment. Kevin?
>
> Cheers,
>
>
> Miles
>
> --
> Miles Sabin
> tel: +44 7813 944 528
> gtalk: miles@milessabin.com
> skype: milessabin
> http://www.chuusai.com/
> http://twitter.com/milessabin
>
>
>
Fri, 2010-09-10, 10:57
#6
Re: Re: Can't compile Scala for Android SDK Tools, revision 7
Maybe this helps: My current installation is:
* Android SDK Tools, revision 7
* Documentation for Android SDK, API 8, revision 1
* SDK Platform Android 2.2, API 8, revision 2
* Samples for SDK API 8, revision 1
* Google APIs by Google Inc., Android API 8, revision 2
* Ant 1.8.1
* Proguard 4.5.1
* Eclipse Helios
* Scala IDE for Helios from http://download.scala-ide.org/nightly-update-helios-2.8.0.final
* Android DDMS Eclipse plugin 0.9.8
* Android Development Tools Eclipse Plugin 0.9.8
Then I follow the instructions at https://www.assembla.com/wiki/show/scala-ide/Developing_for_Android which worked fine till I updated to Android SDK Tools, revision 7.
Do you have any further suggestions, please?
On Sep 10, 2010, at 11:14 AM, Kevin Wright wrote:
> I'm just using the ant builder retrofitted to use scala + proguard, and bypassing the eclipse builder entirely.
>
> You can follow my instructions here:
> http://www.assembla.com/wiki/show/scala-ide/Developing_for_Android
>
> but instead of downloading the ant patch, manually follow the steps described to the newer ant version from rev 7
>
>
>
> On 10 September 2010 10:07, Miles Sabin wrote:
> On Fri, Sep 10, 2010 at 10:03 AM, Normen Müller
> wrote:
> > Just one more questions: are there any improvements/ planes wrt. Scala IDE and developing for Android?
>
> I think the consensus was that the main thing we need is some form of
> cooperation between the Android builder, the Scala builder and
> Proguard. It's doable, but I don't think there's anyone working on it
> at the moment. Kevin?
>
> Cheers,
>
>
> Miles
>
> --
> Miles Sabin
> tel: +44 7813 944 528
> gtalk: miles@milessabin.com
> skype: milessabin
> http://www.chuusai.com/
> http://twitter.com/milessabin
>
>
>
Tue, 2010-09-28, 13:17
#7
Re: Can't compile Scala for Android SDK Tools, revision 7
Not sure if you figured the problem out already, but I ran into it as well and traced it to a missing property "resourcefile" in the "apkbuilder" task call.
Add that property to the task call (I think it's the same value as the "resourcefilename" in the "aaptexec" task) and it should work.
Craig
On Sep 10, 2010, at 4:24 AM, Normen Müller wrote:
> @Miles: Sorry for asking you directly (!!!) but I really need some help and I guess you are one of the persons who could help :-\
>
> He,
>
> I am entirely new to Scala@Android but with the help of
>
> https://www.assembla.com/wiki/show/scala-ide/Developing_for_Android
>
> I managed to get Scala running on Android.
>
> This morning I updated to Android SDK Tools, revision 7, and now nothing is working any longer :(
>
> Initiating ``ant install'' gives me the below listed output. Even modifying the ant script with respect to the warnings still gives me this NPE.
>
> Any help is highly appreciated cause I have to finish a project and want to promote Scala … I really don't wanna switch back to Java … Please help!!!!
>
> --------------------------------------------------------------------------------------------------------------------------------
> $ ant install
> Buildfile: /Users/mun/Projects/I4A/build.xml
> Android SDK Tools Revision 7
> Project Target: Android 2.2
> API level: 8
>
> ------------------
> Resolving library dependencies:
> ------------------
> Ordered libraries:
> ------------------
>
> -compile-tested-if-test:
>
> -dirs:
> Creating output directories if needed...
>
> -resource-src:
> Generating R.java / Manifest.java from the resources...
>
> -aidl:
> Compiling aidl files into Java classes...
>
> compile:
> /Users/mun/Projects/I4A/build.xml:214: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
> Compiling 1 source file to /Users/mun/Projects/I4A/bin/classes
> Compiling 1 scala and 1 java source files to /Users/mun/Projects/I4A/bin/classes
> Compiling 0 scala and 1 java source files to /Users/mun/Projects/I4A/bin/classes
>
> proguard:
> ProGuard, version 4.5.1
> Reading program directory [/Users/mun/Projects/I4A/bin/classes]
> Reading program jar [/Users/mun/Projects/I4A/libs/tiua-0.0.1.jar]
> Reading program jar [/Users/mun/Projects/I4A/tools/scala-library.jar] (filtered)
> Reading library jar [/Users/mun/lib/android-sdk-mac_86/platforms/android-8/android.jar]
> Note: scala.xml.include.sax.Main$$anonfun$3 calls '(org.xml.sax.EntityResolver)Class.forName(variable).newInstance()'
> 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: You're ignoring all warnings!
> Preparing output jar [/Users/mun/Projects/I4A/bin/classes.min.jar]
> Copying resources from program directory [/Users/mun/Projects/I4A/bin/classes]
> Copying resources from program jar [/Users/mun/Projects/I4A/libs/tiua-0.0.1.jar]
> Copying resources from program jar [/Users/mun/Projects/I4A/tools/scala-library.jar] (filtered)
>
> -dex:
> Converting compiled files and external libraries into /Users/mun/Projects/I4A/bin/classes.dex...
>
>
> -package-resources:
> Packaging resources
> WARNNG: Using deprecated 'resources' attribute in AaptExecLoopTask.Use nested element(s) instead.
> WARNNG: Using deprecated 'outfolder' attribute in AaptExecLoopTask.Use 'apkfolder' (path) instead.
> WARNNG: Using deprecated 'basename' attribute in AaptExecLoopTask.Use 'resourcefilename' (string) instead.
> Creating full resource package...
>
> -package-debug-sign:
> WARNING: Using deprecated 'basename' attribute in ApkBuilderTask.Use 'apkfilepath' (path) instead.
> WARNING: Using deprecated inner element in ApkBuilderTask.Use instead.
>
> BUILD FAILED
> /Users/mun/Projects/I4A/build.xml:264: The following error occurred while executing this line:
> /Users/mun/Projects/I4A/build.xml:120: java.lang.NullPointerException
> at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:239)
> [snip]
> --------------------------------------------------------------------------------------------------------------------------------
Fri, 2010-10-01, 01:17
#8
Re: Can't compile Scala for Android SDK Tools, revision 7
Hi!
I run out in the same problem but can't find the references you gave in my
xml;
here are the interesting bits:
and
Any help is welcome!! (I am *still* totally noob at ant)
Fri, 2010-10-01, 08:07
#9
Re: Re: Can't compile Scala for Android SDK Tools, revision 7
Really, use sbt! It makes thinks muuuuuch easier and straightforward.
On Oct 1, 2010, at 2:08 AM, sledorze wrote:
>
> Hi!
> I run out in the same problem but can't find the references you gave in my
> xml;
> here are the interesting bits:
>
> outfolder="${out.absolute.dir}"
> basename="${ant.project.name}"
> signed="@{sign.package}"
> verbose="${verbose}">
>
>
>
>
>
>
>
> and
>
>
> command="package"
> manifest="AndroidManifest.xml"
> resources="${resource.absolute.dir}"
> assets="${asset.absolute.dir}"
> androidjar="${android.jar}"
> outfolder="${out.absolute.dir}"
> basename="${ant.project.name}" />
>
> Any help is welcome!! (I am *still* totally noob at ant)
>
>
Sun, 2010-10-03, 10:17
#10
Re: Can't compile Scala for Android SDK Tools, revision 7
Indeed, Sbt is your friend.
I've switched to Idea (because Eclipse Scala plugin didn't worked out of the
box for me)
and used this combo:
http://github.com/jberkel/android-plugin
http://github.com/mpeltonen/sbt-idea-plugin
http://github.com/orfjackal/idea-sbt-plugin
Next step I did was trying to find out how to debug using this combo.
I've trying the last Ultimate Idea release to check the Android support but
unfortunately, It looks like it cannot abstract over the language and sticks
to java.
Before I start diving in the plumbing:
Have anybody found out a way to debug from the emulator with Idea?
Thanks!
Stephane
P.S.: I will start a new thread to gain more focus.
On Fri, Sep 10, 2010 at 9:24 AM, Normen Müller
wrote:
> @Miles: Sorry for asking you directly (!!!) but I really need some help and I guess you are one of the persons who could help :-\
That NPE is coming out of an Android ant task, so it's pretty much
independent of the Scala IDE ... presumably you could reproduce it on
the command line completely separately from Eclipse. If that's not the
case, then please let me know.
I'm afraid I really don't have any insight into this: you need to talk
to someone who's actively using Scala on Android ... there should be
quite a few people here who are.
Cheers,
Miles