Recognize Flowers with TensorFlow Lite on Android Codelabs - step 4 error
@milincheta  Thanks for reporting the issue.

As the error suggest, the Android SDK version 29 might be required for installation. 

However, as this is not a bug or feature request related to tensorflow, we encourage you to post it in stack overflow or forum.

Thanks. @pjpratik I think its an error on the tutorial. Should be corrected/clarified? @milincheta Could you please let us know which tutorial is being followed. Is it from [tensorflow.org](https://www.tensorflow.org/)? Thanks. https://codelabs.developers.google.com/codelabs/recognize-flowers-with-tensorflow-on-android#0
not to mention that once you finish all the steps the whole thing doesn't work :( Hi @milincheta Sorry for the delayed response.

I have tried to reproduce the issue by using Android API 29 and I was able to successfully run the code on emulator.

Can you please refer to this [#59094](https://github.com/tensorflow/tensorflow/issues/59094) issue on using Flower Classification on latest TF Nightly version and let us know if it helps.

Thank you.

 This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. @milincheta Perhaps
 Close Android Studio.
 Run it as Administrator. 
Then create a new project.
 Perhaps you had an error before the project was created and ignored it @milincheta can I be assignee to solve this issue if it's not solved yet? Hi @pranjalsrv123 , I cannot say who is assigned to fix an issue.
In my opinion is a deeper fundamental issue that, at the end, discourages people to get into coding.
Instead of using your energy to solve your user's problem, you end using it to fix tools, to deal with libraries and versions, googling errors and dealing with tutorials that are wrong.
In my case I managed, after hours dealing with errors, to finish the tutorial. Of course didn't work.
My app is not doing what is supposed to be doing.
Happy to help if you need.
Thanks Hi @milincheta, sorry for the inconvenience caused.

Can I know which Android API and SDK version you are using and did you following the [#TODO](https://codelabs.developers.google.com/codelabs/recognize-flowers-with-tensorflow-on-android#6) steps for recognition?

The issue is not reproducible at my end. Can you post the errors you have encountered during the process?

Thanks. Hi @pjpratik 
API its: Pixel 2 API 30
SDK Android 13 and 10 are installed
besides the error I mentioned on the first message, that now I managed to fix somehow.
I did the #todo however on the code I downloaded some of them were already done...
Now when testing on my mobile device I just see: Fake label and no recognition at all.
By the way I am using my own network that I trained to recognize fruits instead of flowers. @pjpratik 
so, I noticed that the fake label was there...but couldn't find it on the code..so I checked and there are 2 projects....finish and start?
I dont know if that is mentioned and I overlooked it, but anyways confusing.
One project is enough.
Anyways, trying to run Final and I get:
Conflicting declarations: private final val flowerModel: FlowerModel, private final val flowerModel: FlowerModel
Conflicting declarations: private final val flowerModel: FlowerModel, private final val flowerModel: FlowerModel

Overload resolution ambiguity: 
private final val flowerModel: FlowerModel defined in org.tensorflow.lite.examples.classification.MainActivity.ImageAnalyzer
private final val flowerModel: FlowerModel defined in org.tensorflow.lite.examples.classification.MainActivity.ImageAnalyzer

Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
public inline fun <T, R : Comparable<???>> Array<out ???>.sortByDescending(crossinline selector: (???) -> ???): Unit defined in kotlin.collections
public inline fun <T, R : Comparable<???>> MutableList<???>.sortByDescending(crossinline selector: (???) -> ???): Unit defined in kotlin.collections

Unresolved reference: it Hi @milincheta 

You need to work on the `start` project and the #TODO have to be done in the `MainActivity.kt` of the start project.

To resolve the errors, please add the following lines in the `MainActivity.kt`
```
import org.tensorflow.lite.examples.classification.ml.FlowerModel
import org.tensorflow.lite.support.image.TensorImage
```
and restart the activity

Please find the gist [here](https://gist.github.com/pjpratik/3381005e3ccabdc75bfd143804cc95fe) for the reference.

You should see something like this after restarting

<img width="328" alt="Screenshot 2023-03-23 at 5 23 02 PM" src="https://user-images.githubusercontent.com/118897289/227199840-3895753e-c497-472d-8ba7-ec14e7e94f1f.png">

Thanks. @pranjalsrv123 I give up my friend...
those imports where already there.
I copy and paste the code you linked and still get errors.
I will go back to coding in 20 years when tools are more mature.
Thanks for your help!
 @khanhlvg, Reaching out to you, since I see your name in the document commit history.
Do you have any pointers on this?
 @sachinprasadhs I can show you what the problem is.
Thanks! @milincheta , Do you have any solution for it, if so, could you please go ahead and create a PR for same. Thank You @sachinprasadhs I have no idea, that is why I create a ticket.
Happy to have a call and show you.
Thanks! Hi @milincheta,

Apologies for the frustration, I understand it can be quite frustrating running into errors that basically only computers understand. To help us help you, can you please verify some information about your environment. Specifically, you are using Pixel 2 API 30? Are you using a real phone or an emulator? In your project in Android studio do you know which SDK version you are using? (It says you have 10 and 13 installed). If you can export your Android Studio Project and upload it, it will help us see what is wrong with your project. If you have trouble getting the information from Android Studio, this is an excellent use case to try out [bard](https://bard.google.com/) ex: "How do I find out which SDK I'm using in Android Studio?" If you can give us this information, that will help us help you immensely. Hi, thank you for your contact.
I am using a physical device.
Pixel 2 API 30. SDK Android 13 and 10 are ticked on the SDK manager.
If you want to have a call I can show you more.
Thanks! Hi @milincheta, apologies, there seems to be a separate issue w/ tflite-model-maker, as such I can't create the tflite model, Some options include, uploading your tflite model here or exporting your android studio project (with the tflite model included) here. hi @pkgoogle 
https://drive.google.com/file/d/1SgTqOcSQKqcHh3Zu4AJHHHB9noCBrvYJ/view?usp=sharing Hi @milincheta, I was able to successfully run the uploaded project on a Pixel 2 API 30 emulator w/o issue... What error are you running into at this point? As you are using a real device, have you updated the android system on your phone? Can you try using an emulator first and tell us how that goes? hi, it runs...what it is not doing is use my model and detect anything.
doesn't work Hi @milincheta, does the original model work? it does on my jupyter notebook @milincheta Does the original model work on your phone and does it seems to detect flowers reasonably? I just want to make sure it works without any changes, if it does then we know that the process of switching out your model is not complete (i.e. I think you said you changed your labels up there? there's probably some more work you have to do to connect everything properly) This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59815">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59815">No</a>

Just following the steps on a fresh installation of Android studio on ubuntu get the following error when trying to run: Could not find compile target android-29 for modules :start