Skip to content
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

Android - Either publishable_key or package_name is wrong #29

Open
LaTrita97 opened this issue Jul 28, 2023 · 0 comments
Open

Android - Either publishable_key or package_name is wrong #29

LaTrita97 opened this issue Jul 28, 2023 · 0 comments

Comments

@LaTrita97
Copy link

I'm just testing your plugin on an Android device and when I call Roam.initialize() the console prints:

E/GS402   (15207): Either publishable_key or package_name is wrong
W/Gralloc3(15207): mapper 3.x is not supported
I/gralloc (15207): Arm Module v1.0

The publishable_key isn't wrong because is provided by the Dashboard and I just copy and paste it.
The app I created is very simple, is pretty easy to reproduce the error.

This is my code:

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:roam_flutter/roam_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Future<void> init() async {
    Roam.initialize(publishKey: "PUBLISH_KEY");

    await Roam.getUser(
        userId: "USER_ID",
        callBack: ({user}) {
          print(user);
        });

    final startTrackingResult = await Roam.startTracking(
      trackingMode: "active",
    );

    print("startTrackingResult: $startTrackingResult");
  }

  @override
  void initState() {
    init();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text("Roam"),
      ),
    );
  }
}

PS. About the Android configuration, I've added all the permissions in the AndroidManifest.xml file (as is shown in the guidelines), the targetSdkVersion is 32, and the compileSdkVersionis 32as well.

The plugin version is roam_flutter: ^0.1.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant