dongzenglin8292 2015-10-01 16:17
浏览 163
已采纳

Golang-Gomobile基本脚本编译错误

Probably that is newbie question, but that takes me 2 days with 0 progress. I build before Hello Gopher World on my mobile with Android Studio, but when I tried to do that same with 'basic' mobile script from https://godoc.org/golang.org/x/mobile/example/basic I get that error:

Information:Gradle tasks [:app:compileDebugSources, :app:compileDebugAndroidTestSources]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:hello:gobind
exec: "gcc": executable file not found in %PATH%
C:\gowork\bin\gomobile.exe: go build -p=4 -pkgdir=C:\gowork\pkg\gomobile/pkg_android_arm -tags="" -i -buildmode=c-shared -o=C:\Users\Pablo\AppData\Local\Temp\gomobile-work-627382299\android\src\main\jniLibs\armeabi-v7a\libgojni.so C:\Users\Pablo\AppData\Local\Temp\gomobile-work-627382299\androidlib\main.go failed: exit status 2
# _/C_/Users/Pablo/AppData/Local/Temp/gomobile-work-627382299/go_hello
C:\Users\Pablo\AppData\Local\Temp\gomobile-work-627382299\go_hello\go_hellomain.go:8: imported and not used: "golang.org/x/mobile/bind/seq"
C:\Users\Pablo\AppData\Local\Temp\gomobile-work-627382299\go_hello\go_hellomain.go:9: imported and not used: "golang.org/x/mobile/example/bind/hello"
Error:Execution failed for task ':hello:gobind'.
> Process 'command 'C:/gowork/bin\gomobile.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 8.174 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

That is build.gradle of hello module:

plugins {
    id "org.golang.mobile.bind" version "0.2.2"
}

gobind {
    pkg = "golang.org/x/mobile/example/bind/hello"

    GOPATH = "C:/gowork"

    GO = "C:/Go"
}

There is go file: (C:\gowork\src\golang.org\x\mobile\example\bind\hello\hello.go)

http://pastebin.com/PPCn6sPE

And (MainActivity)java file from I try to use function main():

http://pastebin.com/61f8pSSb

  • 写回答

1条回答 默认 最新

  • doudou8783 2015-10-05 19:22
    关注

    Ok, my fault if somebody will have same problem in feature there somebody explained me: https://github.com/golang/go/issues/12842

    In short I tried to build native Go app.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错