Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Railgun reported that while using go-waku in Android with ndk-23 and targeting android 30, their application froze and this error appeared in the logs:
This error is described in detail in ipfs-shipyard/gomobile-ipfs#68, and happens when targeting android API version +30. In this issue a possible solution was described which involved all the steps shown below. I have modified these to take in account that we are using Go 1.18 as well as using a newer version of the Android NDK. (Notice that the fix involves monkeypatching one of the status-go/go-waku dependencies)
According to https://apilevels.com/ , the status app will have to target Sdk 31+ by Nov22 for app updates, so, we'll run into this issue too (assuming we aren't already doing so, if we are targeting android 30).
I'll update these steps as soon as I get a confirmation from Railgun's developers that the fix worked and create a proper issue in status-mobile/status-go. We should also watch golang/go#40569 in case gomobile releases a version that includes this fix.
cc: @alaibe @cammellos @fryorcraken @iurimatias @jakubgs @John-44 @Samyoul
Modifying the react native project
In
MainApplication.java
and
Installing the requirements for gomobile
The following commands were executed in a Digital Ocean droplet, with the root user. It's an example of the actions that are needed and is not meant to be used as is. This script needs to be modified to be run either with nix / docker / bash scripts / etc.
Modifying go.mod and vendor folder
Modify
go.mod
and add the lineand then execute
Verify that the directory
./vendor/git.wow.st
is created. If the directory is not created or ifgo mod download
modifiedgo.mod
intothen this directory will not be copied into
vendor/
bygo mod vendor
, so you can temporarily addinto one of the project's .go files, run
go mod download
again,go get the_go_file_you_modified.go
,run
go mod vendor again
, and then reset the file that was modified withgit checkout the_go_file_you_modified.go
Monkeypatching go-multiaddr
In
vendor/github.com/multiformats/go-multiaddr/net/net.go
replace:with
and
with
A git patch could be created for this operation.
Executing gomobile