roam-ai/roam-flutter

Android - Either publishable_key or package_name is wrong

LaTrita97 opened this issue · 0 comments

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.