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: build lost the "libopenal.so" file without error #12550

Closed
DoraemonYu opened this issue Sep 9, 2015 · 5 comments
Closed

Comments

@DoraemonYu
Copy link

Qucik reproduce steps

  • Make sure go1.5 and gomobile is okay.
  • Rename the directory name of "%GOPATH%\pkg\gomobile\android-ndk-r10e\openal" ( such as "00opengl"), OR delete it.
  • Build your code which import the "exp/audio".

As the result,the output apk will not inculde the "libopenal.so" file in "xxx.apk\lib\armeabi".
I hope in the build process, gomobile can check whether "gomobile-openal-soft" is missing or not. if yes,then throw an exception or a clear tip.
This will help developor to know the reason.
(Currently is builded successfully but lost the "libopenal.so".So after installed apk to device and run,it will got a crash due to "al: cannot load libopenal.so " )

History of this issus

You can find the actual usage scenario here:
#12514
when the gomobile init failed to download the "gomobile-openal-soft-xxxx.tar.gz" , it will cause this issus in build process.


Thank you sincerely.

@ianlancetaylor
Copy link
Contributor

CC @crawshaw

@rakyll rakyll self-assigned this Sep 9, 2015
@rakyll
Copy link
Contributor

rakyll commented Sep 9, 2015

There are two issues:

  • gomobile init shouldn't succeed if it can't download the archive properly.
  • We should fail gomobile build if libopenal.so is not found.

@crawshaw, should we consider adding checksum hash control to see if the downloaded archive's integrity is not compromised?

@rakyll rakyll changed the title x/mobile/cmd/gomobile: building lost the "libopenal.so" file without error or tip x/mobile/cmd/gomobile: build lost the "libopenal.so" file without error Sep 9, 2015
@crawshaw
Copy link
Member

We have a hash: https://github.com/golang/mobile/blob/master/cmd/gomobile/hashes.go#L18

I don't see how gomobile init can succeed if it fails to download OpenAL. I suspect it did fail, but did enough work that gomobile build could run.

There seems to be a bunch of unnecessary tree walking code that if removed will present a nicer error message. I'll send a cl.

@gopherbot
Copy link

CL https://golang.org/cl/14474 mentions this issue.

@DoraemonYu
Copy link
Author

o(∩_∩)o Great!
The issue was fixed. Just now, I do a regression test to make sure it , with the newest version of gomobile.
By the same procedures steps, it will throw an exception message as below:

gomobile: open D:\Gopath\pkg\gomobile\android-ndk-r10e\openal\lib\armeabi\libopenal.so: 
The system cannot find the path specified.

The error message is enough clear now.
Thanks everybody here.

Additionally, I noticed that an apk file is still created at the same time.
Mmm... It was an illegal zip format file, but can use 7z to force to see the files structure.
It just include a empty size file named "AndroidManifest.xml".
Therefore,in my opinion, if gomobile could delete it incidentally when the problem happends, it may be more better, more friendly to developers. Just a small suggestion for this :)


Thank you sincerely.

@golang golang locked and limited conversation to collaborators Sep 22, 2016
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
Fixes golang/go#12550.

Change-Id: I744729cfd702f0e044eac22858ee746096977665
Reviewed-on: https://go-review.googlesource.com/14474
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
Fixes golang/go#12550.

Change-Id: I744729cfd702f0e044eac22858ee746096977665
Reviewed-on: https://go-review.googlesource.com/14474
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
@rsc rsc unassigned rakyll Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants