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

unexpected element <queries> found in <manifest> #1406

Closed
Onibenjo opened this issue Sep 16, 2020 · 26 comments
Closed

unexpected element <queries> found in <manifest> #1406

Onibenjo opened this issue Sep 16, 2020 · 26 comments

Comments

@Onibenjo
Copy link
Contributor

Onibenjo commented Sep 16, 2020

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.35.0
  • react-native v0.63.2

Platform

Tell us to which platform this issue is related

  • iOS
  • Android

Expected behaviour

Successful build

Actual behaviour

node_modules\react-native-image-crop-picker\android\build\intermediates\library_manifest\debug\AndroidManifest.xml:10:5-14:15: AAPT: error: unexpected element found in

Steps to reproduce

  1. npm i react-native-image-crop-picker
  2. react-native run-android

Attachments

// stacktrace or any other useful debug info

Love react-native-image-crop-picker? Please consider supporting our collective:
👉 https://opencollective.com/react-native-image-crop-picker/donate

@ivpusic
Copy link
Owner

ivpusic commented Sep 16, 2020

upgrade your gradle version to be able to recognize new queries element. cc https://stackoverflow.com/questions/62969917/how-do-i-fix-unexpected-element-queries-found-in-manifest

@ivpusic ivpusic closed this as completed Sep 16, 2020
@Onibenjo
Copy link
Contributor Author

thank you, it fixed it.

@SUMITIOS
Copy link

Even after upgrading gradle to 6.5.1 , I keep getting the same error.
My react-native info:

System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
Memory: 25.10 MB / 4.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.6 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 23.0.3, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.2, 29.0.3
Android NDK: Not Found
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_212 - /usr/bin/javac
Python: 2.7.15 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

@kristijantomic
Copy link

kristijantomic commented Sep 23, 2020

You could check this out: https://stackoverflow.com/a/62969918/3501012

After that before new build run:
cd android && ./gradlew clean
cd android && ./gradlew cleanBuildCache

@SUMITIOS
Copy link

SUMITIOS commented Sep 23, 2020

Thank you guys. I already upgraded gradle using:
'brew upgrade gradle'
but get same error. I tried to clean and rebuild but the error remains there.

Solution was to downgrade using:
yarn add react-native-image-crop-picker@^0.33.2

My info:

System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
Memory: 28.05 MB / 4.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.6 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 23.0.3, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.2, 29.0.3
Android NDK: Not Found
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_212 - /usr/bin/javac
Python: 2.7.15 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
react-native-macos: Not Found

@zzeerak
Copy link

zzeerak commented Sep 24, 2020

Hi @SUMITIOS if we downgrade to 0.33.2, how can we get the fix included in 0.35 which fixes the camera on Android 11.

@Onibenjo
Copy link
Contributor Author

Onibenjo commented Sep 24, 2020

No need to downgrade to 0.33.
Upgrade your gradle version classpath 'com.android.tools.build:gradle:4.0.1' or classpath('com.android.tools.build:gradle:4.0.1')

@agungkes
Copy link

Upgrade gradle to 4.0.1 fixed the issue
thanks @Onibenjo

@zzeerak
Copy link

zzeerak commented Sep 24, 2020

I can confirm, upgrading to 4.0.1 fixed the issue. Thanks guys

@SUMITIOS
Copy link

No need to downgrade to 0.33.
Upgrade your gradle version classpath 'com.android.tools.build:gradle:4.0.1'

Thanx, this really solved the issue, I was upgrading gradle version on my system instead of the project. Now its fine but I am facing camera permission error. Hope to get rid of that too. Thanx a lot

@kigh143
Copy link

kigh143 commented Oct 10, 2020

@zzeerak thank you downgrading works fine.

@lfoliveir4
Copy link

Thank you guys. I already upgraded gradle using:
'brew upgrade gradle'
but get same error. I tried to clean and rebuild but the error remains there.

Solution was to downgrade using:
yarn add react-native-image-crop-picker@^0.33.2

My info:

System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
Memory: 28.05 MB / 4.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.6 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 23.0.3, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.2, 29.0.3
Android NDK: Not Found
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_212 - /usr/bin/javac
Python: 2.7.15 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
react-native-macos: Not Found

downgrade to this version, solved to me! thanks!

@SUMITIOS
Copy link

@zzeerak thank you downgrading works fine.

@lfoliveir4 and @kigh143 thank you but plz note that downgrading to 0.33 may cause issue on Android 11 as mentioned by @zzeerak . So kindly check if it works properly on Android 11, otherwise upgrade your project's gradle version by adding classpath('com.android.tools.build:gradle:4.0.1') (inside android/build.gradle dependencies) and use picker version 0.35.0.

@Onibenjo
Copy link
Contributor Author

Onibenjo commented Oct 28, 2020

yea.... downgrading might work but the best option is to upgrade your gradle in your build.gradle file and not your system gradle version @lfoliveir4

@amitsharma-007
Copy link

amitsharma-007 commented Oct 30, 2020

classpath('com.android.tools.build:gradle:4.0.1')

Worked for me!

But I got the following error..

Execution failed for task ':app:stripDebugDebugSymbols'.

No version of NDK matched the requested version 21.0.6113669. Versions available locally: 20.0.5594570, 21.2.6472646

@SUMITIOS
Copy link

@amitsharma-007
If your local NDK version (ie 21.2.6472646) is greater than the requested version (21.0.6113669) you need to mention it inside your android/app/build.gradle file in android {....} as ndkVersion "21.2.6472646" and you will be good to go.
This issue is not related specifically to image picker for more follow
https://stackoverflow.com/questions/60404457/no-version-of-ndk-matched-the-requested-version

@JasonCabral131
Copy link

i install this package in my project and i have an error saying
task :app:processdebugresources failed deprecated gradle features were used in this build, making it incompatible with gradle 7.0.

@iamabdulhaseeb
Copy link

But why the app is crashing when opening camera ?

@Onibenjo
Copy link
Contributor Author

@iamabdulhaseeb I guess you should open a new issue for that

@Louis-jk
Copy link

Louis-jk commented Mar 3, 2021

I also had the same problem.
I fixed it like this.

  1. react-native-image-crop-picker's version downgrade ("react-native-image-crop-picker": "0.36.0" -> "react-native-image-crop-picker": "0.32.2") in "package.json" file

  2. and "node_modules" and "package-lock.json" file deleted.
    : rm -rf node_modules, rm -rf package-lock.json or rm -rf node_modules && package-lock.json

  3. then npm install reinstall node_modules.

  4. then you should check react-native-image-crop-picker's version in package-lock.json and package.json file.
    : if you can checked downgrade version both file ↓ next step

  5. open the "Android Studio" App and open your project android folder(directory) and run "Gradle Sync" and "Build Clean".

  6. finally your editor command line you write "react-native run-android", then you can watch the success build!

Good luck!

@hu-qi
Copy link

hu-qi commented Mar 9, 2021

upgrade your gradle version to be able to recognize new queries element. cc https://stackoverflow.com/questions/62969917/how-do-i-fix-unexpected-element-queries-found-in-manifest

Thanks! Upgrade gradle to 3.5.4 fixed the issue in my case.

-  classpath("com.android.tools.build:gradle:3.5.3")
+ classpath("com.android.tools.build:gradle:3.5.4")

@Junaid3232
Copy link

Junaid3232 commented Apr 1, 2021

1st upgrade the Gradle
Inside android>gradle>wrapper>gradle-wrapper.properties
update the distributionUrl to your specific gradle like :
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
then
inside android>build.gradle
classpath('com.android.tools.build:gradle:4.0.1')
in my case it was
classpath('com.android.tools.build:gradle:3.4.2')
then cd android && ./gradlew clean
and you are done

@AniMaksyan
Copy link

AniMaksyan commented May 27, 2021

Thank you guys. I already upgraded gradle using:
'brew upgrade gradle'
but get same error. I tried to clean and rebuild but the error remains there.

Solution was to downgrade using:
yarn add react-native-image-crop-picker@^0.33.2

My info:

System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz
Memory: 28.05 MB / 4.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.6 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 23.0.3, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.2, 29.0.3
Android NDK: Not Found
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_212 - /usr/bin/javac
Python: 2.7.15 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
react-native-macos: Not Found

The only solution that helped

@carsonxw
Copy link

upgrade your gradle version to be able to recognize new queries element. cc https://stackoverflow.com/questions/62969917/how-do-i-fix-unexpected-element-queries-found-in-manifest

Thanks! Upgrade gradle to 3.5.4 fixed the issue in my case.

-  classpath("com.android.tools.build:gradle:3.5.3")
+ classpath("com.android.tools.build:gradle:3.5.4")

Upgrade gradle from 3.5.3 to 3.5.4 fixed the issue in my case as well.

@ovidiumunteanu
Copy link

1st upgrade the Gradle
Inside android>gradle>wrapper>gradle-wrapper.properties
update the distributionUrl to your specific gradle like :
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
then
inside android>build.gradle
classpath('com.android.tools.build:gradle:4.0.1')
in my case it was
classpath('com.android.tools.build:gradle:3.4.2')
then cd android && ./gradlew clean
and you are done

This fixed for me.

@Afzal97592
Copy link

I am facing issue in realme phones and some android 11 versinon phone when i am clicking photo so after click i am submit the button for upload so my app is reloading and i am not getting any error and not getting any value on console because app is reloading

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