Closed VirRajpurohit closed 5 years ago
This issue does not seem to follow the issue template. Make sure you provide all the required information.
@VirRajpurohit thanks for filing this. How are you loading the project into Android Studio did you:
quickstart-android
project and try to run the mlkit:app
module? ORmlkit
folder and try to run the app
module?@VirRajpurohit I think I found and fixed the issue in https://github.com/firebase/quickstart-android/commit/4c75a7c8fb37a95367e4ca3f05c094fbec1af5cd
@samtstern
I am using 2nd approach.
Changing include ':internal:chooserx' project(':internal:chooserx').projectDir = file('../internal/chooserx') helped to resolve most of this.
but yet ended up with the issue in import of below
import com.google.firebase.quickstart.fcm.java.MainActivity
Please assist.
@VirRajpurohit that sounds like a different issue, are you trying to run the fcm
quickstart?
@samtstern No, I tried running MLKit only.
The issue is in EntryChoiceActivity.kt
return
kotlin.collections.listOf(
Choice(
"Java",
"Run the Firebase Cloud Messaging quickstart written in Java.",
Intent(this, MainActivity::class.java)),
Choice(
"Kotlin",
"Run the Firebase Cloud Messaging written in Kotlin.",
Intent(this, MainActivity::class.java))
)
The MainActivity in above code asks for import
import com.google.firebase.quickstart.fcm.java.MainActivity
Here is the code of manifest.xml
I think there is some issue persist in code yet
`<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.firebase.samples.apps.mlkit">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MaterialTheme">
<meta-data
android:name="com.google.firebase.ml.vision.DEPENDENCIES"
android:value="barcode,face,ocr,ica" />
<activity
android:name="com.google.firebase.samples.apps.mlkit.java.ChooserActivity"/>
<activity
android:name="com.google.firebase.samples.apps.mlkit.kotlin.ChooserActivity"/>
<activity
android:name="com.google.firebase.samples.apps.mlkit.EntryChoiceActivity"
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".java.LivePreviewActivity" android:exported="true">
</activity>
<activity android:name=".kotlin.LivePreviewActivity" android:exported="true"/>
<activity android:name=".java.StillImageActivity"
android:exported="true">
</activity>
<activity android:name=".kotlin.StillImageActivity"
android:exported="true"/>
</application>
`
@VirRajpurohit I think your local state has gotten messed up. I can see the line you're talking about but it's not in the mlkit
quickstart:
As you can see in MLKit there is no such line: https://github.com/firebase/quickstart-android/blob/4c75a7c8fb37a95367e4ca3f05c094fbec1af5cd/mlkit/app/src/main/java/EntryChoiceActivity.kt#L7
I was able to run the following, which shows there is no build issue in messaging
either:
cd messaging
./gradlew assembleDebug
I would say you should clear your local copy and clone
again.
@samtstern Thanks for your consistent help.
Now, while accesing StillImaheActivity and features inside.
I have some error of cloud vision API that it needs to be enabled, but I have not created any project over there.
My project is in firebase.
So does that needs to be added in google console as well?
Please asist.
@VirRajpurohit yes if you want to use cloud models you will need to enable the cloud APIs on your project in the cloud console.
Also please file new issues for any more questions/bugs.
@samtstern Perhaps, Last question in a raw
How I need to add the project on google console?
You mean separately same as I have added it on firebase?
Please assist.
@samtstern
I am using 2nd approach.
Changing include ':internal:chooserx' project(':internal:chooserx').projectDir = file('../internal/chooserx') helped to resolve most of this.
but yet ended up with the issue in import of below
import com.google.firebase.quickstart.fcm.java.MainActivity
Please assist.
Thanks for posting this. I was not included Internal folder due to that it was throwing the dependency errors. It is solved.
I have downloaded the source code and tried running mlkit out of it. I am unable to run it and ended up with several errors. few of them. ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :internal:chooserx.
I have commented the implementation in build.gradle file then bunch of errors I have recieved in EntryChoiceActivity as not finding imports for
import com.firebase.example.internal.BaseEntryChoiceActivity import com.firebase.example.internal.Choice import com.google.firebase.quickstart.fcm.java.MainActivity