Skip to content

Commit f2e957e

Browse files
committed
fix(ios):Pin golang.org/x/mobile to specific version and improve build reliability
1 parent e9fa6db commit f2e957e

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

openlist-lib/scripts/gobind_ios.sh

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,33 @@ else
7777
PARENT_DIR=$(pwd)/..
7878
cd ..
7979

80-
# Add mobile bind packages to the module
81-
echo "Adding mobile bind packages to module..."
82-
go get golang.org/x/mobile/bind@latest
83-
go get golang.org/x/mobile/bind/objc@latest
80+
# Force update mobile packages to latest version
81+
echo "Updating mobile packages to latest version..."
82+
go mod edit -replace golang.org/x/mobile=golang.org/x/mobile@v0.0.0-20250711185624-d5bb5ecc55c0
83+
go get golang.org/x/mobile@v0.0.0-20250711185624-d5bb5ecc55c0
84+
go get golang.org/x/mobile/bind@v0.0.0-20250711185624-d5bb5ecc55c0
85+
go get golang.org/x/mobile/bind/objc@v0.0.0-20250711185624-d5bb5ecc55c0
8486

87+
# Clean and rebuild everything
88+
echo "Cleaning and rebuilding module cache..."
89+
go clean -cache
90+
go clean -modcache
8591
go mod tidy
8692
go mod download
8793

88-
# Verify bind packages are in module
94+
# Verify bind packages are in module with correct version
8995
echo "Verifying bind packages in module:"
90-
go list -m golang.org/x/mobile || echo "mobile module not found"
96+
go list -m golang.org/x/mobile
97+
98+
# Reinstall gomobile tools with the correct version
99+
echo "Reinstalling gomobile tools with correct version..."
100+
go install golang.org/x/mobile/cmd/gomobile@v0.0.0-20250711185624-d5bb5ecc55c0
101+
go install golang.org/x/mobile/cmd/gobind@v0.0.0-20250711185624-d5bb5ecc55c0
102+
103+
# Reinitialize gomobile
104+
echo "Reinitializing gomobile..."
105+
gomobile clean || true
106+
gomobile init
91107

92108
# Return to openlistlib but stay in module context
93109
cd openlistlib

0 commit comments

Comments
 (0)