codelab-mlkit-android
codelab-mlkit-android copied to clipboard
Step 7 - error on define our FirebaseModelInterpreter.
I'm working on getting this step completed but when coping the first code on this into the main activity, Android Studio is giving me "cannot resolve symbol 'FirebaseModelInterpreter'". I've opened the final directory up and it successfully loaded on my phone the completed app.
I do noticed the final app has more imports, so I tried to copy and paste them into the starter app without success. Any advice would be appreciated.
I completed the final MainActivity.java with the starter (after adding the code lab instruction code) and found that the imports and this code in the runModelInference is missing:
.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { e.printStackTrace(); showToast("Error running model inference"); } })
After adding the imports and this code I was able to get this working.
I just wanted to follow up to say I realized why the imports were missing, if you just cut and paste the code it does not allow Android Studio to do the imports for you! Also I realized I missed the step of loading the tf model into the local system, which is why missing the code above make this fail.