You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
While building the release APK for the example project, the build process fails during the R8 minification step. The error indicates missing java.beans classes that are referenced by the SnakeYAML library. Since java.beans is not supported in the Android runtime, the following error is encountered:
Error Log:
ERROR: Missing classes detected while running R8.
Missing class java.beans.BeanInfo
Missing class java.beans.FeatureDescriptor
Missing class java.beans.IntrospectionException
Missing class java.beans.Introspector
Missing class java.beans.PropertyDescriptor
Steps to Reproduce
Clone the yolo-flutter-app repository.
Navigate to the example directory.
Run the following commands to build the release APK:
flutter clean
flutter build apk --release
Observe the build failure during the :app:minifyReleaseWithR8 task.
Expected Behavior
The release APK should be generated successfully without build errors.
Actual Behavior
The build fails with missing classes during the R8 minification step.
👋 Hello @kanakapalli, thank you for submitting a ultralytics/yolo-flutter-app 🚀 Issue. To help us address your concern efficiently, please ensure you've provided all the necessary information outlined below:
For bug reports:
A clear and concise description of the bug 💡
A minimum reproducible example (MRE) that demonstrates the issue. This is crucial for us to understand and address the problem effectively.
Your environment details (OS, Flutter version, Android Studio version, etc.) 🛠️
Expected behavior vs. actual behavior
Any error messages or logs related to the issue (you've included some here, which is helpful! 👍)
For feature requests:
A detailed description of your feature proposal
The problem this feature aims to solve
Any alternative approaches you've considered
For questions:
Provide as much context as possible about your question
Include any research you've done on the topic so far
Specify which parts of the documentation or examples you've already reviewed
Please make sure to search through existing issues to avoid duplicates 🔍. If there's anything else you'd like to add, feel free to comment here!
An Ultralytics engineer will look into this issue soon and assist you further. Thanks for helping us improve the project! 🚀
Locate the proguard-rules.pro file under android/app/proguard-rules.pro.
Add the following rules to prevent R8 from removing java.beans and SnakeYAML classes:
proguard
-keep class java.beans.** { *; }
-dontwarn java.beans.**
-keep class org.yaml.snakeyaml.** { *; }
-dontwarn org.yaml.snakeyaml.**
Rebuild the project with the following commands:
flutter clean
flutter pub get
flutter build apk --release
@kanakapalli thank you for sharing the suggested workaround. Adding the specified R8 keep rules to proguard-rules.pro is an effective solution to prevent class removal issues during minification. If the issue persists, ensure you are using the latest versions of all dependencies and tools. For further assistance, please verify if these steps resolve the problem and share any additional error logs if needed.
Description
While building the release APK for the example project, the build process fails during the R8 minification step. The error indicates missing java.beans classes that are referenced by the SnakeYAML library. Since java.beans is not supported in the Android runtime, the following error is encountered:
Error Log:
Steps to Reproduce
Clone the yolo-flutter-app repository.
Navigate to the example directory.
Run the following commands to build the release APK:
Observe the build failure during the :app:minifyReleaseWithR8 task.
Expected Behavior
The release APK should be generated successfully without build errors.
Actual Behavior
The build fails with missing classes during the R8 minification step.
Environment
Flutter version: 3.27.1
Android Studio: 2024.1
Kotlin version: 1.7.0 or above
Android Gradle Plugin: 8.0.0
The text was updated successfully, but these errors were encountered: