title: How to implement App Check in Flutter app
body: <p>I'm trying to implement App Check in my Flutter app for Android and have followed the flutterfire documentation. I have already complete the installation part outlined here: <a href="https://firebase.flutter.dev/docs/app-check/overview" rel="noreferrer">https://firebase.flutter.dev/docs/app-check/overview</a>
  Now I am following this documentation for usage: <a href="https://firebase.flutter.dev/docs/app-check/usage" rel="noreferrer">https://firebase.flutter.dev/docs/app-check/usage</a></p>
  <p>So I have added the <code>await FirebaseAppCheck.instance.activate(webRecaptchaSiteKey: 'recaptcha-v3-site-key');</code> to my Main method, right after the call to initialize firebase.</p>
  <p>Now I need to enable debugging with the App Check and the documentation says I should add this dependency to my app/build.gradle file: <code>implementation 'com.google.firebase:firebase-appcheck-debug:16.0.0-beta01'</code> and add the following code snippet to my MainActivity.java onCreate method:</p>
  <pre><code>import com.google.firebase.appcheck.FirebaseAppCheck;
  
  FirebaseApp.initializeApp(/*context=*/ this);
  FirebaseAppCheck firebaseAppCheck = FirebaseAppCheck.getInstance();
  firebaseAppCheck.installAppCheckProviderFactory(DebugAppCheckProviderFactory.getInstance());
  </code></pre>
  <p>Which I have tried to do by creating the MainActivity.java with the following command in my project root folder: <code>flutter create -a java .</code></p>
  <p>So my MainActivity.java looks like this:</p>
  <pre><code>import io.flutter.embedding.android.FlutterActivity;
  import com.google.firebase.appcheck.FirebaseAppCheck;
  
  public class MainActivity extends FlutterActivity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              FirebaseApp.initializeApp(/*context=*/ this);
              FirebaseAppCheck firebaseAppCheck = FirebaseAppCheck.getInstance();
              firebaseAppCheck.installAppCheckProviderFactory(
              DebugAppCheckProviderFactory.getInstance());
        }
  }
  </code></pre>
  <p>When trying to run the app in debug mode I get the this error: <code> Execution failed for task ':app:compileDebugJavaWithJavac'.</code></p>
  <p>What am I missing? Have seen other posts with the same problem but no solution.</p>