ipfs-shipyard / gomobile-ipfs

IPFS and libp2p on Mobile, with Gomobile
Other
316 stars 64 forks source link

Could not find ipfs.gomobile:core:0.0.42-dev. #127

Closed ndungudedan closed 1 year ago

ndungudedan commented 1 year ago

Asking a question, not reporting a bug

Is there an existing issue for this?

Question

Trying to build the android example but I get the following error Could not find ipfs.gomobile:core:0.0.42-dev.

Context

Cannot build android example app

jefft0 commented 1 year ago

Hello @ndungudedan . What commands did you enter to build?

ndungudedan commented 1 year ago

@jefft0 I haven't entered any commands. I also can`t find documentation referencing that.

jefft0 commented 1 year ago

Are you trying to build the Android or iOS version? What steps did you do? (If Android, did you open Android Studio? Which folder?)

jefft0 commented 1 year ago

If you are building in Android Studio, first you must build the Go core. In a terminal, enter:

cd packages
make build_core.android
jefft0 commented 1 year ago

Please see the questions above. If we don't hear from you, this issue will be closed as inactive in 14 days.

kf7mxe commented 1 year ago

I had the same problem with it not finding the ipfs.gomobile:core:0.0.42-dev so I ran the command listed above but when I run make build_core.android in the packages directory I get this error

------------------------------------
      Go: installing modules        
------------------------------------
go mod download
make: go: No such file or directory
make: *** [Makefile:362: run] Error 127
jefft0 commented 1 year ago

@kf7mxe , you need to install Go 1.17 from https://go.dev/dl . Then set environment variables:

export GOPATH="$HOME/go"
export PATH="$PATH:$GOPATH/bin"
m-stadnyk commented 1 year ago

Facing the same issue, tried the step suggested, but now seeing another error: Makefile:32: *** "Can't get from Manifest.yml".

If you are building in Android Studio, first you must build the Go core. In a terminal, enter:

cd packages
make build_core.android
jefft0 commented 1 year ago

Hello @JavaMousekin . I created detailed install instructions. We are still improving them and will merge into gomobile-ipfs master soon. Can you please look at the instructions? Is your platform listed? https://github.com/jefft0/gomobile-ipfs/blob/add-INSTALL/INSTALL.md

m-stadnyk commented 1 year ago

Hi @jefft0 appreciate your effort, that is really helpful guide, but now I'm facing the next error: Error: [Errno 2] No such file or directory: '.../gomobile-ipfs/packages/build/android/intermediates/core/core-sources.jar' Seems the lib was not compiled properly, did I miss something? I'm on Windows 11, but running everything using Ubuntu terminal.

jefft0 commented 1 year ago

Are you using Windows Subsystem for Linux? What is the Ubuntu version?

m-stadnyk commented 1 year ago

Yes, it's Ubuntu 20.04.5 LTS

jefft0 commented 1 year ago

I tried on WSL. A requirement is to install and run Android Studio. When I try to launch it, I get the error "Unable to detect graphics environment". Are you able to launch Android Studio?

m-stadnyk commented 1 year ago

Well, I installed Android Studio to the Windows machine itself and pass /mnt/...-like paths to the env variables.

jefft0 commented 1 year ago

I don't think that will work. Need the Linux executables for NDK, etc.

jefft0 commented 1 year ago

Either figure out how to run Android Studio from WSL (I haven't researched this online) or run Ubuntu in a virtual machine like Virtual Box.

m-stadnyk commented 1 year ago

I faced some errors related to the NDK during struggling with this build process before, but after setting ANDROID_NDK_HOME to /mnt/.. directory they have vanished. Any way, I'll try with VB, and post my updates here. Thank u!

jefft0 commented 1 year ago

Thanks. Let us know.

m-stadnyk commented 1 year ago

Hello @jefft0 I did what you suggested, using Ubuntu 22.04 mashine, but now facing another issue, it looks like some Go version missmatch, please advise what should I update or downgrade? image

jefft0 commented 1 year ago

Did you set the environment variables for Ubuntu as shown here? https://github.com/jefft0/gomobile-ipfs/blob/add-INSTALL/INSTALL.md#user-content-build-for-android

Especially important is JAVA_HOME. Do you have a jre at /usr/local/android-studio/jre ?

m-stadnyk commented 1 year ago

@jefft0 your guess was right, I didn't set them properly at first, that was an issue. Please note, usr/local/android-studio/jre contains version 11 by default and it causes another issue: option --boot-class-path not allowed with target 11 So I had to install JDK version 1.8, and set it to the JAVA_HOME. Finally it works now, thanks a lot for your help!

jefft0 commented 1 year ago

@JavaMousekin , you're welcome. Glad to hear you got it working. I haven't seen a message from the original poster in weeks, so I will close this issue. If there is another problem, feel free to open another issue.