[pigeon] Allow newer versions of analyzer (#2249)

diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md
index ce71e24..a2f2819 100644
--- a/packages/pigeon/CHANGELOG.md
+++ b/packages/pigeon/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 3.1.6
+
+* Supports newer versions of `analyzer`.
+
 ## 3.1.5
 
 * Fixes potential crash bug when using a nullable nested type that has nonnull
diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart
index dd6295b..1d69e09 100644
--- a/packages/pigeon/lib/generator_tools.dart
+++ b/packages/pigeon/lib/generator_tools.dart
@@ -9,7 +9,7 @@
 import 'ast.dart';
 
 /// The current version of pigeon. This must match the version in pubspec.yaml.
-const String pigeonVersion = '3.1.5';
+const String pigeonVersion = '3.1.6';
 
 /// Read all the content from [stdin] to a String.
 String readStdin() {
diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml
index cafee49..c148c0f 100644
--- a/packages/pigeon/pubspec.yaml
+++ b/packages/pigeon/pubspec.yaml
@@ -2,14 +2,14 @@
 description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
 repository: https://github.com/flutter/packages/tree/main/packages/pigeon
 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apigeon
-version: 3.1.5 # This must match the version in lib/generator_tools.dart
+version: 3.1.6 # This must match the version in lib/generator_tools.dart
 
 environment:
   sdk: ">=2.12.0 <3.0.0"
   flutter: ">=3.0.0"
 
 dependencies:
-  analyzer: ^2.4.0
+  analyzer: ">=2.4.0 <5.0.0"
   args: ^2.0.0
   collection: ^1.15.0
   meta: ^1.7.0