Skip to content

App check android installation #6522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Albertbol opened this issue Jul 1, 2021 · 2 comments
Closed

App check android installation #6522

Albertbol opened this issue Jul 1, 2021 · 2 comments
Labels
resolution: duplicate This issue or pull request already exists

Comments

@Albertbol
Copy link

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

@Albertbol Albertbol added good first issue Good for newcomers type: documentation Improvements or additions to documentation labels Jul 1, 2021
@seanyyyyyy
Copy link

seanyyyyyy commented Jul 2, 2021

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 added the triage Issue is currently being triaged. label Jul 2, 2021
@darshankawar
Copy link

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

@darshankawar darshankawar added resolution: duplicate This issue or pull request already exists and removed good first issue Good for newcomers triage Issue is currently being triaged. type: documentation Improvements or additions to documentation labels Jul 2, 2021
@firebase firebase locked and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants