~eliasnaur/gio

3 2

gogio issues finding packages

Details
Message ID
<D13R7N0COXUV.SKHSA56BNFFU@ser1.net>
DKIM signature
pass
Download raw message
Hi,

I'm assuming some user error, but looking through the tickets and the mailing
list, I don't see anyone else encountering this, so I'm stuck.

I have an application that compiles and runs on my desktop. When I follow the
instructions for cross-compiling to Android, though, I get errors from gogio:

```
gogio -target android .
gogio: go list -f {{.Dir}} gioui.org/app/internal/window failed: no required module provides package gioui.org/app/internal/window; to add it:
        go get gioui.org/app/internal/window  
```

That package apparently does not exist:

```
go get gioui.org/app/internal/window
go: module gioui.org@upgrade found (v0.6.0), but does not contain package gioui.org/app/internal/window
```

I fell back on trying to install the gioui kitchen example, with the same results.

I'm importing gioui v0.6.0, and I can't tell the version of gogio, although
what's in my Go modules directory is some 0.0.0 (untagged) version:

`gioui.org/cmd@v0.0.0-20240414063439-c9121dcb8c26/gogio/`

Have events moved past the README? Is there a new way of cross-compiling to
Android? Should I be using an earlier version of gioui?

Thx,

--- SER   
Sean E. Russell    
Age: age195vpft7nzsy83medxagqqsge0lrcuf9txe3z2znlu2wsk69cdu4sx8nfvp    
GPG key: https://ser1.net/.well-known/pgp.asc
Details
Message ID
<D163FZ3V4QVZ.2D1BQ19X77WY9@ser1.net>
In-Reply-To
<D13R7N0COXUV.SKHSA56BNFFU@ser1.net> (view parent)
DKIM signature
pass
Download raw message
Ok, so I cleaned out and re-installed gogio from @latest, and now I'm getting
different errors which might be related to Android SDK version incompatability.

I _can_ successfully build an archive with `-buildmode archive`, so I could
probably get the rest of the way with the Android build tools.

```
gogio -buildmode exe -target android -appid net.ser.forage2 -o forage2.apk .
gogio: /opt/android-sdk/build-tools/34.0.0/d8 --lib /opt/android-sdk/platforms/android-34/android.jar --output /tmp/gogio-2368606926/apk --min-api 16 /tmp/gogio-2368606926/classes/org/gioui/Gio$1.class /tmp/gogio-2368606926/classes/org/gioui/Gio.class /tmp/gogio-2368606926/classes/org/gioui/GioActivity.class /tmp/gogio-2368606926/classes/org/gioui/GioView$1.class /tmp/gogio-2368606926/classes/org/gioui/GioView$2.class /tmp/gogio-2368606926/classes/org/gioui/GioView$3.class /tmp/gogio-2368606926/classes/org/gioui/GioView$Bar.class /tmp/gogio-2368606926/classes/org/gioui/GioView$GioInputConnection.class /tmp/gogio-2368606926/classes/org/gioui/GioView$Snippet.class /tmp/gogio-2368606926/classes/org/gioui/GioView.class failed: Error in /tmp/gogio-2368606926/classes/org/gioui/GioView$1.class:
java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
Compilation failed with an internal error.
```

and then the usual couple dozen lines of Java stack trace -- ending curiously with:

```
Caused by: [CIRCULAR REFERENCE: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null]
```

This is Go 1.22, OpenJDK 22, and Android SDK (and NDK) 26, targeting android-64.
Can someone recommend a known set of versions that I could install to eliminate
some variables that might be causing this error? Is anyone reliably using gogio
to build APKs? [WormholeWilliam](https://github.com/psanford/wormhole-william-
mobile) uses the `archive` buildmode and then gradlew to assemble the APK, and
was last updated 6 months ago; and [hrm](https://git.wow.st/gmp/hrm) uses gogio
directly but was last updated 3 years ago. I get the same NPE building hrm. I
can't build WHW, but that looks like a version incompatibility, gradle saying it
doesn't support class major version 66 -- it's not immediately (obviously)
related to what I'm seeing in my project with `-buildmode exe`, especially since
the gradle being pulled looks like it had just added support for Java 18 (and
I'm running Java 22).

I'm going to try downgrading some versions, but advice or guidance on known
dependency versions would be appreciated.

Thanks,

--- SER   
Sean E. Russell    
Age: age195vpft7nzsy83medxagqqsge0lrcuf9txe3z2znlu2wsk69cdu4sx8nfvp    
GPG key: https://ser1.net/.well-known/pgp.asc
Details
Message ID
<D163QI691V49.2OS1Z5ULFR8OO@ser1.net>
In-Reply-To
<D163FZ3V4QVZ.2D1BQ19X77WY9@ser1.net> (view parent)
DKIM signature
pass
Download raw message
Well, for anyone else encountering issues and finding this thread: I downgraded
to Java 17 and `-buildmode exe` works. Haven't tried running it yet, but the
build works. So the maximum compatible Java version is [17,22)

--- SER   
Sean E. Russell    
Age: age195vpft7nzsy83medxagqqsge0lrcuf9txe3z2znlu2wsk69cdu4sx8nfvp    
GPG key: https://ser1.net/.well-known/pgp.asc
Details
Message ID
<e80ee0f9-212c-447e-9c85-5ba82a0eee31@app.fastmail.com>
In-Reply-To
<D163QI691V49.2OS1Z5ULFR8OO@ser1.net> (view parent)
DKIM signature
pass
Download raw message
The "safe" maximum OpenJDK is 8 (with some luck: 11), IIRC. Gio uses D8 tool [0], 
which is stuck on Java 8. Gio also uses JDK8 on CI [1], so it's the recommended
version.

[0]: https://developer.android.com/tools/d8
[1]: https://github.com/gioui/gio/blob/main/.builds/linux.yml#L70-L72
-- 
  Lucas Rodrigues
  inkeliz@inkeliz.com

On Fri, May 10, 2024, at 5:23 PM, Sean E. Russell wrote:
> Well, for anyone else encountering issues and finding this thread: I downgraded
> to Java 17 and `-buildmode exe` works. Haven't tried running it yet, but the
> build works. So the maximum compatible Java version is [17,22)
>
> --- SER   
> Sean E. Russell    
> Age: age195vpft7nzsy83medxagqqsge0lrcuf9txe3z2znlu2wsk69cdu4sx8nfvp    
> GPG key: https://ser1.net/.well-known/pgp.asc
Reply to thread Export thread (mbox)