zeshuaro / google_api_headers

A Flutter plugin for getting the headers required to call Google APIs with an app restricted API key
https://pub.dev/packages/google_api_headers
MIT License
8 stars 22 forks source link

build fails with flutter beta #69

Closed mockturtl closed 2 years ago

mockturtl commented 2 years ago

I've been using google_api_headers: ^1.1.1 successfully on flutter's stable channel (2.10.5).

When I change to Flutter beta (2.13.0-0.2.pre), I get Android build errors.

I can reproduce them in this repo's example/ app (on branch main).

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: /path/to/google_api_headers/android/src/main/kotlin/io/github/zeshuaro/google_api_headers/
     GoogleApiHeadersPlugin.kt: (52, 68): Type mismatch: inferred type is String? but String was expected
e: ...GoogleApiHeadersPlugin.kt: (58, 68): Type mismatch: inferred type is String? but String was expected

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':google_api_headers:compileDebugKotlin'.
environment
$ flutter --version
Flutter 2.13.0-0.2.pre • channel beta • https://github.com/flutter/flutter
Framework • revision 8662e22bac (28 hours ago) • 2022-04-20 08:21:52 -0700
Engine • revision 24a02fa5ee
Tools • Dart 2.17.0 (build 2.17.0-266.5.beta) • DevTools 2.12.2
Android Studio Bumblebee | 2021.1.1 Patch 3
Build #AI-211.7628.21.2111.8309675, built on March 16, 2022
Runtime version: 11.0.11+0-b60-7590822 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.16.0-0.bpo.4-amd64
zeshuaro commented 2 years ago

Hey @mockturtl, thanks for raising the issue. This has already been raised in #56 and a pre-release version 1.3.0-dev.0 was released to address it. Can you try this version and see if it works for you?

mockturtl commented 2 years ago

@zeshuaro Ah! Sorry for the duplicate. 1.3.0-dev.0 resolves it.

I did need to bump my android.compileSdkVersion to 32 for https://github.com/zeshuaro/google_api_headers/commit/f8331ea68d7115661296fdb056146c5938cb5669. You may want to call that out in the changelog.

Thanks!

zeshuaro commented 2 years ago

Good call, I'll update the changelog. Thanks!