Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile/cmd/gomobile: gomobile-build fails due to header-files not found error #24644

Closed
hajimehoshi opened this issue Apr 2, 2018 · 13 comments
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@hajimehoshi
Copy link
Member

hajimehoshi commented Apr 2, 2018

What version of Go are you using (go version)?

go version go1.10 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/hajimehoshi/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hajimehoshi/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/go-build013947351=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

gomobile build -target ios golang.org/x/mobile/example/basic

What did you expect to see?

Build succeeds.

What did you see instead?

Build failed:

gomobile: go build -tags ios -o=/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/gomobile-work-875171040/arm golang.org/x/mobile/example/basic failed: exit status 2
# golang.org/x/mobile/exp/gl/glutil
go/src/golang.org/x/mobile/exp/gl/glutil/context_darwin_desktop.go:15:9: fatal error: 'OpenGL/OpenGL.h' file not found
#import <OpenGL/OpenGL.h>
        ^~~~~~~~~~~~~~~~~
1 error generated.
# golang.org/x/mobile/app
go/src/golang.org/x/mobile/app/darwin_desktop.go:16:9: fatal error: 'Carbon/Carbon.h' file not found
#import <Carbon/Carbon.h> // for HIToolbox/Events.h
        ^~~~~~~~~~~~~~~~~
1 error generated.

Additional information

$ gomobile version
gomobile version unknown: binary is out of date, re-install it

I removed gomobile and redid go-get, but I couldn't remove this error.

@gopherbot gopherbot added this to the Unreleased milestone Apr 2, 2018
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 2, 2018
@AlexRouSg
Copy link
Contributor

Do you have xcode installed?

@hajimehoshi
Copy link
Member Author

Yes.

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 2, 2018
@bcmills
Copy link
Contributor

bcmills commented Apr 2, 2018

(CC @eliasnaur)

@hajimehoshi
Copy link
Member Author

The above error happened with 54bca6061991cbde3139dc01ec713e2bba9cdb51.

With the previous one 4e3d9b79444693d916d1ae1f1d358cb13ba479e1, the situation changed:

$ gomobile build -target=ios golang.org/x/mobile/example/basic
gomobile: xcrun xcodebuild -configuration Release -project /var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/gomobile-work-221160388/main.xcodeproj -allowProvisioningUpdates DEVELOPMENT_TEAM=JF56W8HGC5 failed: exit status 65
Build settings from command line:
    DEVELOPMENT_TEAM = JF56W8HGC5

=== BUILD TARGET main OF PROJECT main WITH CONFIGURATION Release ===

Check dependencies
2018-04-03 11:25:33.311 xcodebuild[6547:153334]  DVTPortal: Service '<DVTPortalAddAppIDService: 0x7fa2dbfd6100; action='addAppId'>' encountered an unexpected result code from the portal ('9401')
2018-04-03 11:25:33.311 xcodebuild[6547:153334]  DVTPortal: Error:
Error Domain=DVTPortalServiceErrorDomain Code=9401 "An App ID with Identifier 'org.golang.todo.basic' is not available. Please enter a different string." UserInfo={payload=<CFBasicHash 0x7fa2d96ccfb0 [0x7fff9fa5aaf0]>{type = mutable dict, count = 10,
entries =>
        0 : <CFString 0x7fa2dbf7d7d0 [0x7fff9fa5aaf0]>{contents = "requestId"} = <CFString 0x7fa2dc338a30 [0x7fff9fa5aaf0]>{contents = "FDC58D0A-2A94-4CFE-AB6D-86AF0D29B4BA"}
        1 : responseId = <CFString 0x7fa2dc32cf70 [0x7fff9fa5aaf0]>{contents = "af8a5adc-56fc-4053-94f1-ccd31e79d372"}
        2 : <CFString 0x7fff9f97db58 [0x7fff9fa5aaf0]>{contents = "protocolVersion"} = QH65B2
        3 : <CFString 0x7fa2dbf51a00 [0x7fff9fa5aaf0]>{contents = "requestUrl"} = <CFString 0x7fa2dbf6c200 [0x7fff9fa5aaf0]>{contents = "https://developerservices2.apple.com/services/QH65B2/ios/addAppId.action"}
        6 : <CFString 0x7fa2dc344310 [0x7fff9fa5aaf0]>{contents = "userLocale"} = en_US
        8 : resultCode = <CFNumber 0x24b937 [0x7fff9fa5aaf0]>{value = +9401, type = kCFNumberSInt64Type}
        9 : userString = <CFString 0x7fa2dc344b70 [0x7fff9fa5aaf0]>{contents = "An App ID with Identifier 'org.golang.todo.basic' is not available. Please enter a different string."}
        10 : <CFString 0x7fa2dbf57de0 [0x7fff9fa5aaf0]>{contents = "resultString"} = <CFString 0x7fa2dc344b70 [0x7fff9fa5aaf0]>{contents = "An App ID with Identifier 'org.golang.todo.basic' is not available. Please enter a different string."}
        11 : httpCode = <CFNumber 0xc837 [0x7fff9fa5aaf0]>{value = +200, type = kCFNumberSInt64Type}
        12 : <CFString 0x7fa2dc30b9f0 [0x7fff9fa5aaf0]>{contents = "creationTimestamp"} = <CFString 0x7fa2dc3493b0 [0x7fff9fa5aaf0]>{contents = "2018-04-03T02:25:33Z"}
}
, NSLocalizedDescription=An App ID with Identifier 'org.golang.todo.basic' is not available. Please enter a different string.}
Code Signing Error: Failed to create provisioning profile. The app ID "org.golang.todo.basic" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.
Code Signing Error: No profiles for 'org.golang.todo.basic' were found:  Xcode couldn't find any iOS App Development provisioning profiles matching 'org.golang.todo.basic'.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.3'

** BUILD FAILED **


The following build commands failed:
        Check dependencies
(1 failure)

@gopherbot
Copy link

Change https://golang.org/cl/104355 mentions this issue: app,exp/gl/glutil: add missing build directives

@eliasnaur
Copy link
Contributor

eliasnaur commented Apr 3, 2018

CL 104355 should fix the compilation error.

The gomobile version issue is #24389 stalled on #24558.

The App ID problem is #20241.

@hajimehoshi
Copy link
Member Author

hajimehoshi commented Apr 3, 2018

I have another similar issue, and I am not sure this is related to the issues above.

go get -u github.com/hajimehoshi/go-inovation
cd $GOPATH/src/github.com/hajimehoshi/go-inovation
gomobile bind -v -target ios -o ./mobile/ios/Mobile.framework github.com/hajimehoshi/go-inovation/mobile

fails with this message:

# github.com/hajimehoshi/ebiten/internal/devicescale
../ebiten/internal/devicescale/impl_ios.go:22:10: fatal error: 'UIKit/UIKit.h' file not found
 #import <UIKit/UIKit.h>
         ^~~~~~~~~~~~~~~
1 error generated.
# golang.org/x/mobile/gl
In file included from ../../../golang.org/x/mobile/gl/work.go:28:
./work.h:18:10: fatal error: 'OpenGLES/ES2/glext.h' file not found
#include <OpenGLES/ES2/glext.h>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
gomobile: gobind -lang=go,objc -outdir=/var/folders/7t/qw3np69559591s1v0mk5_p1m0000gn/T/gomobile-work-847470222 -tags=ios github.com/hajimehoshi/go-inovation/mobile failed: exit status 1

git-bisect says 4600df55ca9f03689ade154095e4daf53a00e223 is the cause.

@gopherbot
Copy link

Change https://golang.org/cl/104458 mentions this issue: cmd/gomobile: don't run gobind with the ios tag

@hajimehoshi
Copy link
Member Author

I think the problem at #24644 (comment) is not solved yet.

@eliasnaur
Copy link
Contributor

CL 104458 should fix that problem.

@hajimehoshi
Copy link
Member Author

I confirmed the error (gomobile bind for iOS) is still happening with the latest gomobile.

@eliasnaur
Copy link
Contributor

Did you try with CL 104458 applied? It's not submitted yet.

@hajimehoshi
Copy link
Member Author

Oh, I've not tried that, sorry

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Apr 3, 2018
gopherbot pushed a commit to golang/mobile that referenced this issue Apr 5, 2018
Bindings are independent of any particular GOOS/GOARCH pair and
as such the gomobile bind command doesn't set GOOS nor GOARCH when
running gobind. However, the ios tag was still added to the list
of tags to pass to gobind for -target=ios.

Move the ios tag to when actually building the bound packages,
mirroring gomobile build.

Add TestBindIOS and update TestBindAndroid.

Updates golang/go#24644

Change-Id: I007829c26036427a3376bba11a1ccb86e7338848
Reviewed-on: https://go-review.googlesource.com/104458
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
@golang golang locked and limited conversation to collaborators Apr 3, 2019
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
For some reason, the changes to the build tags that was supposed to
go in with CL 102915 didn't make it.

Fixes golang/go#24644

Change-Id: I106b3c71fef1088dd1eea193323c13d81e5985fa
Reviewed-on: https://go-review.googlesource.com/104355
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
For some reason, the changes to the build tags that was supposed to
go in with CL 102915 didn't make it.

Fixes golang/go#24644

Change-Id: I106b3c71fef1088dd1eea193323c13d81e5985fa
Reviewed-on: https://go-review.googlesource.com/104355
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants