diff --git a/CHANGELOG.md b/CHANGELOG.md index cb070da894..000174a5a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ This file lists the main changes with each version of the Fyne toolkit. More detailed release notes can be found on the [releases page](https://github.com/fyne-io/fyne/releases). -## 2.0.4 - 3 August 2021 +## 2.0.4 - 4 August 2021 ### Changed diff --git a/cmd/fyne/internal/mobile/binres/binres.go b/cmd/fyne/internal/mobile/binres/binres.go index 049923b174..9a3ab7b396 100644 --- a/cmd/fyne/internal/mobile/binres/binres.go +++ b/cmd/fyne/internal/mobile/binres/binres.go @@ -205,7 +205,7 @@ var skipSynthesize bool // UnmarshalXML decodes an AndroidManifest.xml document returning type XML // containing decoded resources. -func UnmarshalXML(r io.Reader, withIcon bool) (*XML, error) { +func UnmarshalXML(r io.Reader, withIcon bool, targetSDK int) (*XML, error) { tbl, err := OpenTable() if err != nil { return nil, err @@ -281,7 +281,7 @@ func UnmarshalXML(r io.Reader, withIcon bool) (*XML, error) { Space: androidSchema, Local: "targetSdkVersion", }, - Value: "30", + Value: strconv.Itoa(targetSDK), }, }, } diff --git a/cmd/fyne/internal/mobile/build.go b/cmd/fyne/internal/mobile/build.go index 56ce72c9f0..274d2c16f4 100644 --- a/cmd/fyne/internal/mobile/build.go +++ b/cmd/fyne/internal/mobile/build.go @@ -143,7 +143,7 @@ func runBuildImpl(cmd *command) (*packages.Package, error) { } return pkg, nil } - nmpkgs, err = goAndroidBuild(pkg, buildBundleID, targetArchs, cmd.IconPath, cmd.AppName, cmd.Version, cmd.Build) + nmpkgs, err = goAndroidBuild(pkg, buildBundleID, targetArchs, cmd.IconPath, cmd.AppName, cmd.Version, cmd.Build, buildRelease) if err != nil { return nil, err } diff --git a/cmd/fyne/internal/mobile/build_androidapp.go b/cmd/fyne/internal/mobile/build_androidapp.go index c27c4d0128..c30c032f70 100644 --- a/cmd/fyne/internal/mobile/build_androidapp.go +++ b/cmd/fyne/internal/mobile/build_androidapp.go @@ -24,7 +24,7 @@ import ( ) func goAndroidBuild(pkg *packages.Package, bundleID string, androidArchs []string, - iconPath, appName, version string, build int) (map[string]bool, error) { + iconPath, appName, version string, build int, release bool) (map[string]bool, error) { ndkRoot, err := ndkRoot() if err != nil { return nil, err @@ -209,7 +209,11 @@ func goAndroidBuild(pkg *packages.Package, bundleID string, androidArchs []strin } } - bxml, err := binres.UnmarshalXML(bytes.NewReader(manifestData), arsc.iconPath != "") + target := 30 + if !release { + target = 29 // TODO once we have gomobile debug signing working for v2 android signs + } + bxml, err := binres.UnmarshalXML(bytes.NewReader(manifestData), arsc.iconPath != "", target) if err != nil { return nil, err }