azihsoyn / flutter_mlkit

A Flutter plugin to use the Firebase ML Kit.
MIT License
391 stars 90 forks source link

Wrong package name #6

Closed PsyOhm23 closed 6 years ago

PsyOhm23 commented 6 years ago

Hi, First, thank you for developing this MLKit plugin for flutter :) I'm trying to configure your plugin but it seems that it don't take my package name When I launch my app, I have this error :

Could you tell me if there is a place to give my package name ? Thank's

azihsoyn commented 6 years ago

Hi! Thank you for trying my package and sorry for the inconvenience.

You may build for android. Please try following step.

  1. change applicationId in <root>/android/app/build.gradle

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "<your application id>" // here
    }
  2. change package name in <root>/android/app/src/main/AndroidManifest.xml

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="<your application id>"> // here
  3. configure firebase https://firebase.google.com/docs/android/setup?authuser=1

In add application phase, you need use same application id at step 1, 2.

Thanks.

PsyOhm23 commented 6 years ago

Hi, Thank you for your response Unfortunately, i've already set my package name in both build.gradle and manifest according to my firebase project but i still have this error.

I encounter an other issue with the google-services.json file. It says that is missing from the searched location :

I cant make another issue about this if you want

Otherwise, did you try your plugin outside your plugin project ? I mean that you're maybe not in a real app configuration ? and it could help you for understanding those issues Thank you

azihsoyn commented 6 years ago

OK.

  1. add plugin to <project root>/android/build.gradle
    
    buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:3.2.0' // google-services plugin
    }
    }

allprojects { // ... repositories { // ... maven { url "https://maven.google.com" // Google's Maven repository } } }


2. enable plugin in `<project root>/android/app/build.gradle`

apply plugin: 'com.android.application'

android { // ... }

dependencies { // Getting a "Could not find" error? Make sure you have // added the Google maven respository to your root build.gradle }

// ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services'



https://firebase.google.com/docs/android/setup

I hope this help you.

Thanks.
PsyOhm23 commented 6 years ago

Hi, Sorry for my late answer but i still have the issue :( I've just create an empty Flutter project and add the dependency in pubspec.yaml for simplicity The Google Services Plugin continues searching for google-services.json in the cache folder of mlkit flutter plugin (the same folders that I've mentionned in my previous answer). Did you try your plugin in a separate project ? Maybe there is a parameter to indicate to your plugin where is the google-services.json file?

Thank you for your time :)

azihsoyn commented 6 years ago

Ok, I'll try it! Thanks.

azihsoyn commented 6 years ago

Hi, @PsyOhm23 !

I'm very sorry... It was flutter_mlkit's bug. https://github.com/azihsoyn/flutter_mlkit/pull/15/files#diff-7ae5a9093507568eabbf35c3b0665732L40

Now it fixed, so please use flutter_mlkit ^0.2.2.

Thank you for reporting!

azihsoyn commented 6 years ago

And I pushed sample app repo. https://github.com/azihsoyn/flutter_mlkit_sample

PsyOhm23 commented 6 years ago

Thank you very much !! Now it's working perfectly ;) Thank's for the sample too 👍

AseemWangoo commented 6 years ago

Great work....!!!!!!!!!!

azihsoyn commented 6 years ago

Thx 😁