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: bind generates bad android manifest.xml; missing minSdk #12661

Closed
Qubitium opened this issue Sep 17, 2015 · 2 comments
Closed

Comments

@Qubitium
Copy link

Env

gomobile version +ef84e05 Thu Sep 17 03:25:18 2015 +0000 (android);
android studio 1.4b4

Problem

Gobind plugin generated aar library have minSdk missing from the generated manifest.xml resulting in READ_PHONE_STATE permission inserted into apk build result even when this permission is not specified anywhere.

When android studio/gradle merges the aar libary manifest with app's manifest.xml, it will notice the golib aar library's minSdk is missing and assume some weird default settings and insert a READ_PHONE_STATE permission in the final merged manifest even when the app manifest doesn't use or specify this permission.

<android:uses-permission android:name="android.permission.READ_PHONE_STATE" />

Fix

Line 162 of bind_androidapp.go

const manifestFmt = `<manifest xmlns:android="http://schemas.android.com/apk/res/android" package=%q/>`

Should be as follows or similar with minSdk specified:

const manifestFmt = `<manifest xmlns:android="http://schemas.android.com/apk/res/android" package=%q><uses-sdk android:minSdkVersion="7"/></manifest>`
@rakyll rakyll changed the title x/mobile bind_androidapp.go generates bad android manifest.xml: missing minSdk x/mobile/cmd/gomobile: bind generates bad android manifest.xml; missing minSdk Sep 21, 2015
@rakyll rakyll added this to the Unreleased milestone Sep 21, 2015
@rakyll
Copy link
Contributor

rakyll commented Sep 21, 2015

/cc @crawshaw @hyangah

swisspol added a commit to swisspol/mobile that referenced this issue Sep 21, 2015
@gopherbot
Copy link

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

hyangah added a commit to golang/mobile that referenced this issue Oct 1, 2015
The fix for golang/go#12661 was incorrect.

Fixes golang/go#12809.

Change-Id: Ic2cfedcc99ced0241a5756fb36f6f9ae5a6b7287
Reviewed-on: https://go-review.googlesource.com/15270
Reviewed-by: Burcu Dogan <jbd@google.com>
@golang golang locked and limited conversation to collaborators Oct 4, 2016
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
Fixes golang/go#12661.

Change-Id: I9f37159cd8090454bf2dd59126bece6647b9f3b8
Reviewed-on: https://go-review.googlesource.com/14883
Reviewed-by: David Crawshaw <crawshaw@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
Fixes golang/go#12661.

Change-Id: I9f37159cd8090454bf2dd59126bece6647b9f3b8
Reviewed-on: https://go-review.googlesource.com/14883
Reviewed-by: David Crawshaw <crawshaw@golang.org>
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

3 participants