Repository: flutter
Issue: [in-app-purchase] package fails silently when build.gradle setup is incorrect.
Labels: platform-android,p: in_app_purchase,package,P2,team-android,triaged-android

The README of `in-app-purchase` tells the user not to add the `com.android.billingclient:billing` dependency to your application's `build.gradle`. If you do add it, the package will fail silently. That is, the call `InAppPurchase.instance.isAvailable()` never returns and neither gives an error message. 

Since Google's documentation referred to earlier in the README contains instructions telling the user to add the billing dependency, it's an easy mistake to make.

Steps to reproduce:
* Setup in-app-purchase dependency as per the [in-app-purchase documentation](https://pub.dev/packages/in_app_purchase).
* Add the following dependency to your app-level `build.gradle` (to be clear, a user shouldn't do this but it's an easy mistake to make):
```
dependencies {
    implementation("com.android.billingclient:billing:4.0.0")
}
```
* Enable pending purchases in Android as follows:
```
if (defaultTargetPlatform == TargetPlatform.android) {
    InAppPurchaseAndroidPlatformAddition.enablePendingPurchases();
  }
```
* Initialize IAP by calling
```
InAppPurchase iap = InAppPurchase.instance;
bool available = await iap.isAvailable();
```
* Sometimes, when rerunning the app a few times, `InAppPurchase.instance.isAvailable()` actually returns `true`. In this case, the package will halt at the following call which is:
```
iap.queryProductDetails(['your_product_id']);
```

Package version: `in_app_purchase: ^1.0.8`

Output of `flutter doctor -v`:
```
flutter doctor -v
[✓] Flutter (Channel stable, 2.5.1, on Ubuntu 20.04.3 LTS 5.4.0-84-generic, locale en_US.UTF-8)
    • Flutter version 2.5.1 at /home/jurrian/flutter
    • Upstream repository git@github.com:flutter/flutter.git
    • Framework revision ffb2ecea52 (7 days ago), 2021-09-17 15:26:33 -0400
    • Engine revision b3af521a05
    • Dart version 2.14.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /home/jurrian/Android/Sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /home/jurrian/Android/Sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 60.1.2
    • Dart plugin version 203.8292
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.2)
    • IntelliJ at /opt/idea-IU-202.7660.26
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.51.1)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82

• No issues found!

```