MatsuriDayo / NekoBoxForAndroid

NekoBox for Android / sing-box / universal proxy toolchain for Android
https://matsuridayo.github.io/
Other
11.76k stars 986 forks source link

BUG: support on compilation error #729

Closed nsysp4 closed 1 month ago

nsysp4 commented 3 months ago

I get this error:

$ ./build.sh write C:\Users\Stur\AppData\Local\Temp\gomobile-work-1293562640\src-android-arm64\go.mod write C:\Users\Stur\AppData\Local\Temp\gomobile-work-1293562640\src-android-arm\go.mod write C:\Users\Stur\AppData\Local\Temp\gomobile-work-1293562640\src-android-386\go.mod write C:\Users\Stur\AppData\Local\Temp\gomobile-work-1293562640\src-android-amd64\go.mod go: error reading go.mod: missing module declaration. To specify the module path: go mod edit -module=example.com/mod go: error reading go.mod: missing module declaration. To specify the module path: go mod edit -module=example.com/mod go: error reading go.mod: missing module declaration. To specify the module path: go mod edit -module=example.com/mod go: error reading go.mod: missing module declaration. To specify the module path: go mod edit -module=example.com/mod C:\Users\Stur\go\bin\gomobile.exe: go mod tidy -v failed: exit status 1

I modified a line in a .sh file at ChatGPT's suggestion and still haven't been able to make any progress. Thanks for your support

!/bin/bash

source ../buildScript/init/env_ndk.sh

BUILD=".build"

rm -rf $BUILD/android \ $BUILD/java \ $BUILD/javac-output \ $BUILD/src

gomobile bind -v -androidapi 21 -cache $(realpath $BUILD) -trimpath -ldflags='-s -w' -tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_ech' . || exit 1

gomobile bind -v -androidapi 21 -trimpath -ldflags='-s -w' -tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api,with_ech' . || exit 1 rm -r libcore-sources.jar

proj=../app/libs mkdir -p $proj cp -f libcore.aar $proj echo ">> install $(realpath $proj)/libcore.aar"

dou23 commented 3 months ago

Please try the command in the root directory of the project: ./run lib core