Task :expo-crypto:compileReleaseKotlin FAILED after installing expo-auth-session - react-native

After installing expo-auth-session the android build is crashing.
> Task :expo-crypto:compileReleaseKotlin FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

The error was resolved after adding expo-crypto and all the other dependencies mentioned in yarn.lock.
I think the error occurred because expo-crypto is the dependency of expo-auth-session.
screenshot from yarn.lock.

Related

i having issues with eas build. always stuck on run gradle

Android build failed:
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
**any solution? **
the same as in this forum but I also haven't found the answer
https://github.com/expo/eas-cli/issues/1496
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
try
expo doctor
expo doctor --fix-dependencies
but not fixed

react-native - Upgrading to Gradle 7 breaks project

react-native: 0.66.4
Upgraded:
Gradle Plugin from 4.2.2 to 7.0.2
Gradle from 6.9.0 to 7.2.0
When running react-native run-android got:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/chen.oppenhaim/dev/toluna-mobile-app/mobile-apps/node_modules/react-native-rate/android/build.gradle' line: 41
* What went wrong:
A problem occurred evaluating project ':react-native-rate'.
> Plugin with id 'maven' not found.
Its seems that now one of my react-native packages (react-native-rate) is not compatible with Gradle 7.
I guess that once I fixed this issue - other packages as well will have incompatibilities issues as well.
How should I approach this issue?
android/build.gradle (Gradle plugin version):
buildscript {
dependencies {
classpath('com.android.tools.build:gradle:7.0.2')
}
}
gradle-wrapper.properties (Gradle version):
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
Finally solved it.
Those Gradle plugin and Gradle upgrades are possible in react-native project but keep in mind that other react-native packages in your project might not be compatible with Gradle 7.
Specific for the error I got - upgrading react-native-rate to latest version solve the issue - but it was not the only upgrade I needed to do - so you can expect that (overall 4 upgrades).
Also not sure What I gain from this Gradle upgrade but this is another discussion.

when i tried to launch react-native application on physical device this error i got

Task :app:processDebugMainManifest FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

Execution failed for task ':app:processDebugResources'[flutter]

I am developing an flutter e-commerce app for both Android and IOS users. When I run my code, its shows an resource error, I couldn't find the answers.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\JEYASRI.A\AndroidStudioProjects\flutter_foodapp\build\file_picker\intermediates\library_manifest\debug\AndroidManifest.xml:9:5-15:15: AAPT: error: unexpected element <queries> found in <manifest>.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 47s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin cloud_firestore...
Running Gradle task 'assembleAarRelease'...
Exception: The plugin cloud_firestore could not be built due to the issue above.```
Please note that you are getting the following error:
AAPT: error: unexpected element <queries> found in <manifest>.
The error is stating that the element is not being recognized by Android Gradle Plugin.
Android 11 introduced <queries> as a manifest element and older versions of the Android Gradle Plugin do not have this element.
So it could be that you are using an Android Gradle Plugin which does not allow the element.
There are some series of patch versions released by Google in order to fix this error (3.3.3, 3.4.3, 3.5.4, 3.6.4 and 4.0.1).
So please upgrade your build gradle version to one from the above list.
Android Studio 4.1 or higher, with a matching
Android Gradle Plugin (e.g 4.1.* series) does recognize manifest element so they don't face these types of errors.
Have a look into the Android Developers Blog post.

Run realm with android experimental plugin

Is there a way to use Realm with the latest Android experimental plugin for Gradle:
http://tools.android.com/tech-docs/new-build-system/gradle-experimental ?
Here is an error message, which I've got during application build:
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'realm-android']
> 'com.android.application' or 'com.android.library' plugin required.
I'm interested in Realm, but I need to use experimental plugin because of its NDK support the same time.
Update Android Studio to 2.2 resolved the problem.
"There are other choices now like the the ndk with cmake which doesn't require the experimental plugin https://github.com/googlesamples/android-ndk/tree/master-cmake/hello-jni ."
found here