Skip to content

App check android installation #6522

Closed
Closed
@Albertbol

Description

@Albertbol

Hey,
Please provide a better explanation of how to integrate App check for android and add working Kotlin snippet, most of the users don't have MainActivity.java only Kotlin MainActivity file and even creating it with flutter create -a java . and importing java snippet throws an error.
android/app/src/main/java/project_folder/MainActivity

package *name*

import io.flutter.embedding.android.FlutterActivity;
import com.google.firebase.appcheck.FirebaseAppCheck;


public class MainActivity extends FlutterActivity {
    FirebaseApp.initializeApp(this);
    FirebaseAppCheck firebaseAppCheck = FirebaseAppCheck.getInstance();
    firebaseAppCheck.installAppCheckProviderFactory(DebugAppCheckProviderFactory.getInstance());
}

Throws:

Running Gradle task 'assembleDebug'...
/MainActivity.java:8: error: <identifier> expected
    FirebaseApp.initializeApp(this);
                             ^
/MainActivity.java:8: error: illegal start of type
    FirebaseApp.initializeApp(this);
                              ^
/MainActivity.java:10: error: <identifier> expected
    firebaseAppCheck.installAppCheckProviderFactory(DebugAppCheckProviderFactory.getInstance());
                                                   ^
/MainActivity.java:10: error: <identifier> expected
    firebaseAppCheck.installAppCheckProviderFactory(DebugAppCheckProviderFactory.getInstance());
                                                                                          ^
4 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
Exception: Gradle task assembleDebug failed with exit code 1

Thanks

Activity

seanyyyyyy

seanyyyyyy commented on Jul 2, 2021

@seanyyyyyy

could working implementations for debug provider be put inside the Example repo too?
https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_app_check/firebase_app_check/example

darshankawar

darshankawar commented on Jul 2, 2021

@darshankawar

@Albertbol
There's similar open issue describing your case, #6468
Please follow-up there for updates.
Closing this as duplicate.

added and removed
triageIssue is currently being triaged.
type: documentationImprovements or additions to documentation
on Jul 2, 2021
locked and limited conversation to collaborators on Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Albertbol@seanyyyyyy@darshankawar

        Issue actions

          App check android installation · Issue #6522 · firebase/flutterfire