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

[Regression] Pose Detection 18 beta1 / beta2 errors when building due to uses-native-library #477

Closed
fmardini opened this issue Apr 12, 2022 · 2 comments

Comments

@fmardini
Copy link

Describe the bug
This happens when using ML Kit with Flutter. Creating a flutter plugin with version 18 beta1 works without any issues but using 18 beta2 is failing with

AAPT: error: unexpected element <uses-native-library> found in <manifest><application>.

To Reproduce
Example Steps to reproduce the behavior in sample app:

  1. flutter create --org com.foo --template=plugin --platforms=android -a kotlin mlkit_pose
  2. Add dependency on 18beta1 to android/build.gradle
  3. cd example; flutter run -> ALL GOOD
  4. Add dependency on 18beta2 to android/build.gradle -> BUILD FAILS

Expected behavior
Build to succeed

SDK Info:

  • implementation 'com.google.mlkit:pose-detection-accurate:18.0.0-beta1' WORKS
  • implementation 'com.google.mlkit:pose-detection-accurate:18.0.0-beta2' FAILS

Development Environment:
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/fmardini/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.

[✓] Flutter (Channel stable, 2.10.4, on Mac OS X 10.15.7 19H1715 darwin-x64, locale en-GB)
• Flutter version 2.10.4 at /usr/local/Caskroom/flutter/2.10.1/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c860cba910 (3 weeks ago), 2022-03-25 00:23:12 -0500
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2

@ai-plays
Copy link
Collaborator

The usage of was added in version 18.0.0-beta2 to deal with some Android 12+ requirements.

Could you try to see if upgrading your gradle version for Android build could fix it? See https://stackoverflow.com/questions/71615873/cannot-run-flutter-plugin-aapt-error-unexpected-element-uses-native-library

@fmardini
Copy link
Author

Thanks. I had initially tried that, but it didn't work. I tried again, but this time changing the build.gradle for both the plugin and the application got it to work. I'll create an issue on the flutter side so they update the project template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants