Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package R does not exist #79

Open
nouser000 opened this issue Dec 12, 2024 · 6 comments
Open

package R does not exist #79

nouser000 opened this issue Dec 12, 2024 · 6 comments
Labels
bug Something isn't working dependencies Dependencies and packages

Comments

@nouser000
Copy link

nouser000 commented Dec 12, 2024

I have created a new project, added the package and when I run it it shows me the error:
error: package R does not exist

Log:

C:\Users\myuser\AppData\Local\Pub\Cache\hosted\pub.dev\ultralytics_yolo-0.0.3\android\src\main\java\com\ultralytics\ultralytics_yolo\NativeView.java:30: error: package R does not exist
        view = LayoutInflater.from(context).inflate(R.layout.activity_tflite_camera, null);
                                                     ^
C:\Users\myuser\AppData\Local\Pub\Cache\hosted\pub.dev\ultralytics_yolo-0.0.3\android\src\main\java\com\ultralytics\ultralytics_yolo\NativeView.java:31: error: package R does not exist
        mPreviewView = view.findViewById(R.id.previewView);
                                          ^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

FAILURE: Build failed with an exception.

Flutter Version 3.24.5
Dart 3.5.4
Java version 18.0.2.1
Gradle 8.3

@pderrenger pderrenger added bug Something isn't working dependencies Dependencies and packages labels Dec 12, 2024
@pderrenger
Copy link
Member

pderrenger commented Dec 12, 2024

👋 Hello @nouser000, thank you for submitting a ultralytics/yolo-flutter-app 🚀 Issue. To help us address your concern efficiently, please ensure you've provided the following information:

  1. For bug reports:

    • A clear and concise description of the bug, which you've provided (thank you 😊)
    • A minimum reproducible example https://docs.ultralytics.com/help/minimum_reproducible_example/ that demonstrates the issue. This will help us accurately reproduce and debug your issue.
    • Your environment details (e.g., OS version, Flutter version, Android Studio version, package versions, etc.)
    • Expected behavior vs. actual behavior of the application
    • Complete error messages or logs if possible, which you've partially shared (it’s helpful if you provide the full log for more context).
  2. For troubleshooting:

    • Ensure all build configurations (like Gradle settings, project dependencies) are correctly set up. If you're unsure, please provide details about the steps you followed to integrate the package so we can pinpoint potential issues.
  3. For questions:

    • If you’re seeking clarification on usage, configuration, or error handling, please share what documentation or resources you've already reviewed. For example, have you consulted the documentation or existing examples?

Please double-check similar issues in the Issues page to avoid duplicates. If the problem persists, feel free to update this thread with additional details.

Rest assured, an Ultralytics engineer will review this issue shortly and assist you further. Thanks again for contributing and helping us improve the project! 🚀

@nouser000
Copy link
Author

Windows 11
package version: ultralytics_yolo: ^0.0.3
Flutter Version 3.24.5
Dart 3.5.4
Java version 18.0.2.1
Gradle 8.3

@glenn-jocher
Copy link
Member

@john-rocky can you take a look at this please?

@aftercxde
Copy link

aftercxde commented Dec 24, 2024

same error here

@pderrenger
Copy link
Member

Thank you for confirming. Please ensure you're using the latest version of the ultralytics_yolo package. Additionally, try running flutter clean, then rebuild the project to regenerate the R class. If the issue persists, double-check your Gradle and dependency setup. Let us know if further clarification is needed!

@john-rocky
Copy link
Collaborator

@nouser000 @aftercxde
Thanks for getting in contact!
If you want to use it as a module in another app, try importing R explicitly.

import com.ultralytics.ultralytics_yolo.R;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Dependencies and packages
Projects
None yet
Development

No branches or pull requests

5 participants