-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: INSTALL_FAILED_INVALID_APK when dashes in package #12273
Comments
CC @crawshaw |
CL https://golang.org/cl/13873 mentions this issue. |
Updates golang/go#12273 Change-Id: I8eac3e84d5a473e9ffe45705cea88537573aef61 Reviewed-on: https://go-review.googlesource.com/13873 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
I have the new project without dash on a Windows machine and I get exactly the same problem.
|
Confirmed this issue exists on OS X as well and I just lost an hour to it! |
Please provide the output of % go version and device model & android version. Also, @neoranga55 Can you send me the produced basic.apk? |
% go version % gomobile version The issue I saw was installing from a directory with a dash in it "go-mobile" the app itself didn't contain a dash and neither did it use a package with one. The target platform was HTC One M7 with Android 5.0.2 Renaming the directory fixed the problem and I was able to run on Android and IOS |
To clarify I had no problems with any example apps. |
On a Xperia Z3 with 5.1.1 APK is in the link and MD5 sum is 0ACE1CC04AB31127C43424E01D18EC51 |
CL https://golang.org/cl/16875 mentions this issue. |
https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html "This can occur if the domain name contains a hyphen or other special character, if the package name begins with a digit or other character that is illegal to use as the beginning of a Java name, or if the package name contains a reserved Java keyword, such as "int". In this event, the suggested convention is to add an underscore." The sanitized name is used for the app package name and the default apk file name. Update golang/go#12273 Change-Id: I76d7f423e87c54a5bb7ab71ec251fd3a26da9722 Reviewed-on: https://go-review.googlesource.com/16875 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Is this still a problem? |
@eliasnaur , no idea. I moved away from Maybe other people in the thread that have also experienced the issue can check. |
Updates golang/go#12273 Change-Id: I8eac3e84d5a473e9ffe45705cea88537573aef61 Reviewed-on: https://go-review.googlesource.com/13873 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html "This can occur if the domain name contains a hyphen or other special character, if the package name begins with a digit or other character that is illegal to use as the beginning of a Java name, or if the package name contains a reserved Java keyword, such as "int". In this event, the suggested convention is to add an underscore." The sanitized name is used for the app package name and the default apk file name. Update golang/go#12273 Change-Id: I76d7f423e87c54a5bb7ab71ec251fd3a26da9722 Reviewed-on: https://go-review.googlesource.com/16875 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Updates golang/go#12273 Change-Id: I8eac3e84d5a473e9ffe45705cea88537573aef61 Reviewed-on: https://go-review.googlesource.com/13873 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html "This can occur if the domain name contains a hyphen or other special character, if the package name begins with a digit or other character that is illegal to use as the beginning of a Java name, or if the package name contains a reserved Java keyword, such as "int". In this event, the suggested convention is to add an underscore." The sanitized name is used for the app package name and the default apk file name. Update golang/go#12273 Change-Id: I76d7f423e87c54a5bb7ab71ec251fd3a26da9722 Reviewed-on: https://go-review.googlesource.com/16875 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Hi,
It seems that it is not possible to build an Android application from Go source code if there is a dash (
-
) somewhere in the Go package name. Since my organization on GitHub has a dash inside, this means I cannot build any Android applications whatsoever.You can easily test this with the currently available Go 1.5 release version.
golang.org/x/mobile/example/basic
example application and move it to thegolang.org/x/mobile/example/basic-demo
folder.gomobile build -target=android golang.org/x/mobile/example/basic-demo
command.adb install basic-demo
command.You will get the following error:
Now, you might ask me why didn't I use the
gomobile install
command instead. There seems to be another issue as well. If you run thegomobile install
command, you will not receive any output to the terminal at all. Furthermore, you will even get an exit code of0
. It seems that thegomobile
command hides any issues coming from theadb
command.My best guess is that somewhere in the manifest you place the package name. At least for Java based applications, I know that they don't allow dashes in the package names and you are advised to substitute those with underscores. (http://stackoverflow.com/questions/3179216/what-is-the-convention-for-word-separator-in-java-package-names) I guess a similar validation is performed even if the application is not Java based. This is just a hunch, I might be totally off base.
The text was updated successfully, but these errors were encountered: