public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* first Android app - Didn't find class
@ 2016-04-17  1:48 Claude Marinier
  2016-04-17  4:23 ` F. Rafael Leon
  0 siblings, 1 reply; 9+ messages in thread
From: Claude Marinier @ 2016-04-17  1:48 UTC (permalink / raw)
  To: kawa

Hi,

I followed the instructions on the Kawa web site. The page is here.

    https://www.gnu.org/software/kawa/Building-for-Android.html

The simple hello app compiles. I can install it on the emulator and
click its icon to run it. I displays a window with a title bar and
dies; 'adb logcat' displays a lot of messages. I think this one is
significant.

    Didn't find class "kawa.android.hello" on path:
        DexPathList[[zip file "/data/app/kawa.android-1.apk"]

Many lines before this, a message seems to use a different name for
the app (extra slash).

    I/ActivityManager(  356): START u0 {act=android.intent.action.MAIN
        cat=[android.intent.category.LAUNCHER] flg=0x10200000
        cmp=kawa.android/.hello} from pid 632o

I chose Android 4.4.2 which is API 19 because that's what my old
Galaxy Tab runs.

I was so happy when I got it to compile and install. I am used to the
world of Linux using vim and make. This is much more complicated. I
may be missing something obvious.

Please help.

Thanks.

-------

Ubuntu 14.04 64-bit
lib32stdc++6  lib32z1
jdk-7u79-linux-x64.tar.gz
android-sdk_r24.4.1-linux.tgz
kawa-2.1.tar.gz

-- 
Claude Marinier

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: first Android app - Didn't find class
  2016-04-17  1:48 first Android app - Didn't find class Claude Marinier
@ 2016-04-17  4:23 ` F. Rafael Leon
  2016-04-17  5:17   ` Per Bothner
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: F. Rafael Leon @ 2016-04-17  4:23 UTC (permalink / raw)
  To: Claude Marinier; +Cc: kawa

Claude,

I am not an ANT expert, but I have some Kawa Android experience using gradle.

On the page that you referenced:

https://www.gnu.org/software/kawa/Building-for-Android.html

It says to copy this file into your ant build tree:

https://sourceware.org/viewvc/kawa/trunk/gnu/kawa/android/custom_rules.xml?view=markup

I believe that xml rules file is responsible for creating
/kawa/android/hello.class in the correct location.

That class file must be created in the correct location in the build
tree to be included into the apk.

The extra "/" in the error message is nothing to worry about.
I think it just separates the package name from class name.

If you have more trouble, upload the whole thing to a public github
repo and I will download it and fix it.

Good luck.

    -Rafael

On Sat, Apr 16, 2016 at 9:48 PM, Claude Marinier <claudem223@gmail.com> wrote:
> Hi,
>
> I followed the instructions on the Kawa web site. The page is here.
>
>     https://www.gnu.org/software/kawa/Building-for-Android.html
>
> The simple hello app compiles. I can install it on the emulator and
> click its icon to run it. I displays a window with a title bar and
> dies; 'adb logcat' displays a lot of messages. I think this one is
> significant.
>
>     Didn't find class "kawa.android.hello" on path:
>         DexPathList[[zip file "/data/app/kawa.android-1.apk"]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: first Android app - Didn't find class
  2016-04-17  4:23 ` F. Rafael Leon
@ 2016-04-17  5:17   ` Per Bothner
  2016-04-17  5:21   ` Per Bothner
       [not found]   ` <CAPg6usC95-BBUniSY_hHFJvGm160kLwi7eYNybFj08Uhm9pgFw@mail.gmail.com>
  2 siblings, 0 replies; 9+ messages in thread
From: Per Bothner @ 2016-04-17  5:17 UTC (permalink / raw)
  To: F. Rafael Leon, Claude Marinier; +Cc: kawa



On 04/16/2016 09:22 PM, F. Rafael Leon wrote:
> Claude,
>
> I am not an ANT expert, but I have some Kawa Android experience using gradle.
> ...
> If you have more trouble, upload the whole thing to a public github
> repo and I will download it and fix it.

Thanks a lot for helping out - it's much appreciated.

[I've mostly been working on the "invoke" branch - which at this point
only has a very small number of test suite failures.]
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: first Android app - Didn't find class
  2016-04-17  4:23 ` F. Rafael Leon
  2016-04-17  5:17   ` Per Bothner
@ 2016-04-17  5:21   ` Per Bothner
  2016-04-17  6:42     ` F. Rafael Leon
       [not found]   ` <CAPg6usC95-BBUniSY_hHFJvGm160kLwi7eYNybFj08Uhm9pgFw@mail.gmail.com>
  2 siblings, 1 reply; 9+ messages in thread
From: Per Bothner @ 2016-04-17  5:21 UTC (permalink / raw)
  To: F. Rafael Leon; +Cc: kawa

On 04/16/2016 09:22 PM, F. Rafael Leon wrote:

> I am not an ANT expert, but I have some Kawa Android experience using gradle.

This page: http://developer.android.com/sdk/index.html
implies Gradle has become the default Android build tool
(which matches my vague recollection ...).

Would it make sense to update the Kawa/Android instructions to use Gradle
rather than Ant?
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: first Android app - Didn't find class
  2016-04-17  5:21   ` Per Bothner
@ 2016-04-17  6:42     ` F. Rafael Leon
  2016-04-24 16:10       ` Adrián Medraño Calvo
  0 siblings, 1 reply; 9+ messages in thread
From: F. Rafael Leon @ 2016-04-17  6:42 UTC (permalink / raw)
  To: Per Bothner; +Cc: kawa

On Sun, Apr 17, 2016 at 1:20 AM, Per Bothner <per@bothner.com> wrote:
> Would it make sense to update the Kawa/Android instructions to use Gradle
> rather than Ant?

The answer is yes.  Gradle is the accepted standard.

For introducing current Android developers to Kawa, gradle would be
the path of least friction.

The minimal "kawaBuild" task from this gradle file should still work:

https://github.com/rafleon/KawaDroid/blob/master/app/build.gradle

preDexDebug doesn't exist in gradle anymore, so the new dependency is:

project.afterEvaluate{
    compileDebugSources.dependsOn kawaBuild
    compileReleaseSources.dependsOn kawaBuild
  }

That should do it. I haven't pushed updates to github in awhile.

Gradle has some faults (slow, complicated, bloated, etc), but it is
indeed the current Android standard.
They are legitimately working on improving it, so it should be fine eventually.
For example, this new feature is an enormous step in the right direction:

http://tools.android.com/tech-docs/instant-run

Instant Run pushes fresh compiled classes into the context of a
running mobile app.
It is not immediately obvious what the relationship could be between
Instant Run and a Kawa REPL,
but interesting tricks should be possible once the official build
tools are stable.

   -Rafael

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Fwd: first Android app - Didn't find class
       [not found]   ` <CAPg6usC95-BBUniSY_hHFJvGm160kLwi7eYNybFj08Uhm9pgFw@mail.gmail.com>
@ 2016-04-17 20:11     ` Claude Marinier
       [not found]       ` <CALPCXwjLYwFBx2zpS6B-xmqYAFps3yGtrUKG=_eUzmt3chfSZg@mail.gmail.com>
  2016-04-18  0:05       ` Fwd: " Per Bothner
  0 siblings, 2 replies; 9+ messages in thread
From: Claude Marinier @ 2016-04-17 20:11 UTC (permalink / raw)
  To: kawa

Good morning,

I missed the step to link the custom_rules.xml. My apologies.

However, there is another problem: I cannot find the file on my
computer. It is neither in the specified directory nor in the
kawa-2.1.tar.gz archive.

Since it is in the subversion repository, I downloaded it from there.

The build now fails with a new error.

  scompile:
       [java] Error: Could not find or load main class kawa.repl

The the XML file references the REPL class here.

    <java failonerror="true" fork="true" classname="kawa.repl">

Looks like I need to edit the XML file. What changes do I need to make?

Thank you.

-- 
Claude Marinier

On 17 April 2016 at 00:22, F. Rafael Leon <teflon@ucdavis.edu> wrote:
>
> Claude,
>
> I am not an ANT expert, but I have some Kawa Android experience using gradle.
>
> On the page that you referenced:
>
> https://www.gnu.org/software/kawa/Building-for-Android.html
>
> It says to copy this file into your ant build tree:
>
> https://sourceware.org/viewvc/kawa/trunk/gnu/kawa/android/custom_rules.xml?view=markup
>
> I believe that xml rules file is responsible for creating
> /kawa/android/hello.class in the correct location.
>
> That class file must be created in the correct location in the build
> tree to be included into the apk.
>
> The extra "/" in the error message is nothing to worry about.
> I think it just separates the package name from class name.
>
> If you have more trouble, upload the whole thing to a public github
> repo and I will download it and fix it.
>
> Good luck.
>
>     -Rafael
>
> On Sat, Apr 16, 2016 at 9:48 PM, Claude Marinier <claudem223@gmail.com> wrote:
> > Hi,
> >
> > I followed the instructions on the Kawa web site. The page is here.
> >
> >     https://www.gnu.org/software/kawa/Building-for-Android.html
> >
> > The simple hello app compiles. I can install it on the emulator and
> > click its icon to run it. I displays a window with a title bar and
> > dies; 'adb logcat' displays a lot of messages. I think this one is
> > significant.
> >
> >     Didn't find class "kawa.android.hello" on path:
> >         DexPathList[[zip file "/data/app/kawa.android-1.apk"]


-- 
Claude Marinier

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: first Android app - Didn't find class
       [not found]       ` <CALPCXwjLYwFBx2zpS6B-xmqYAFps3yGtrUKG=_eUzmt3chfSZg@mail.gmail.com>
@ 2016-04-17 23:50         ` Claude Marinier
  0 siblings, 0 replies; 9+ messages in thread
From: Claude Marinier @ 2016-04-17 23:50 UTC (permalink / raw)
  To: kawa; +Cc: F. Rafael Leon

The name of the link I created is "libs/kawa.jar" which matches the XML file.


On 17 April 2016 at 18:05, F. Rafael Leon <teflon@ucdavis.edu> wrote:
> On Sun, Apr 17, 2016 at 4:10 PM, Claude Marinier <claudem223@gmail.com> wrote:
>> The the XML file references the REPL class here.
>>
>>     <java failonerror="true" fork="true" classname="kawa.repl">
>>
>> Looks like I need to edit the XML file. What changes do I need to make?
>
> I think the problem is in this line:
>
>             <pathelement path="libs/kawa.jar" />
>
> Maybe it needs to be:
>
>             <pathelement path="libs/kawa-2.1.jar" />
>
> Or you can set a symbolic link.
> In the build instructions, there is a command for setting this path:
>
> $ ln -s $KAWA_DIR/kawa-2.1.jar libs/kawa.jar
>
>     -Rafael



-- 
Claude Marinier

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Fwd: first Android app - Didn't find class
  2016-04-17 20:11     ` Fwd: " Claude Marinier
       [not found]       ` <CALPCXwjLYwFBx2zpS6B-xmqYAFps3yGtrUKG=_eUzmt3chfSZg@mail.gmail.com>
@ 2016-04-18  0:05       ` Per Bothner
  1 sibling, 0 replies; 9+ messages in thread
From: Per Bothner @ 2016-04-18  0:05 UTC (permalink / raw)
  To: Claude Marinier, kawa



On 04/17/2016 01:10 PM, Claude Marinier wrote:
> Good morning,
>
> I missed the step to link the custom_rules.xml. My apologies.
>
> However, there is another problem: I cannot find the file on my
> computer. It is neither in the specified directory nor in the
> kawa-2.1.tar.gz archive.
>
> Since it is in the subversion repository, I downloaded it from there.

Oops - I fixed that in the gnu/kawa/android/Makefile.am source
so that will be fixed *next* release.

For people serious serious Kawa work, I recommend using the Subversion
sources, since I don't make releases as often as I'd like.  It's difficult
to say "now" in terms of making a release.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: first Android app - Didn't find class
  2016-04-17  6:42     ` F. Rafael Leon
@ 2016-04-24 16:10       ` Adrián Medraño Calvo
  0 siblings, 0 replies; 9+ messages in thread
From: Adrián Medraño Calvo @ 2016-04-24 16:10 UTC (permalink / raw)
  To: kawa

Dear list,

On 04/17/2016 08:41 AM, F. Rafael Leon wrote:
> On Sun, Apr 17, 2016@1:20 AM, Per Bothner <per@bothner.com> wrote:
>> Would it make sense to update the Kawa/Android instructions to use Gradle
>> rather than Ant?
> 
> The answer is yes.  Gradle is the accepted standard.
> 
> For introducing current Android developers to Kawa, gradle would be
> the path of least friction.

Indeed.  Please, check out the new gradle-kawa-plugin:

    https://github.com/medranocalvo/gradle-kawa-plugin

The plugin integrates Kawa into the Android build system (buildTypes,
productFlavors, etc...).  There's yet no convenient support for
standalone Kawa projects, though it should not be difficult to add.  I
use a rather simple build script myself for Android, we'll see how well
it copes with more complex ones.  Rafael, I read that you have recently
published an app (congratulations!), it would be great if you could try
to build it with the plugin.

There are many possible improvements...  I would like to have some
automated testing, in order to make sure it works with many
Gradle/Android versions.  Time is scarce, tough.  Needless to say, it
would be great if people using Kawa on Android give a hand.

I'm being optimistic and have called it 0.8 already :-).  Looking
forward to your comments!

Best regards,
Adrián.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-24 16:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-17  1:48 first Android app - Didn't find class Claude Marinier
2016-04-17  4:23 ` F. Rafael Leon
2016-04-17  5:17   ` Per Bothner
2016-04-17  5:21   ` Per Bothner
2016-04-17  6:42     ` F. Rafael Leon
2016-04-24 16:10       ` Adrián Medraño Calvo
     [not found]   ` <CAPg6usC95-BBUniSY_hHFJvGm160kLwi7eYNybFj08Uhm9pgFw@mail.gmail.com>
2016-04-17 20:11     ` Fwd: " Claude Marinier
     [not found]       ` <CALPCXwjLYwFBx2zpS6B-xmqYAFps3yGtrUKG=_eUzmt3chfSZg@mail.gmail.com>
2016-04-17 23:50         ` Claude Marinier
2016-04-18  0:05       ` Fwd: " Per Bothner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).