Configure Project : react-native-reanimated - react-native

Configure project :react-native-reanimated
Native libs debug enabled: true
Android gradle plugin: 7.0.4
Gradle: 7.3.3
building Reanimated2

Upgrade your react-native-reanimated to v2.9.1 to fix the problem.
Then
cd android
./gradlew clean
You can check more details and answers from here

Configure project :react-native-reanimated
Native libs debug enabled: false
Android gradle plugin: 7.0.4
Gradle: 7.3.3
building Reanimated2
[CXX1101] NDK at /Users/iasonasxrist/Library/Android/sdk/ndk/21.4.7075529 did not have a source.properties file
This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.

Related

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.

No variants found for `react-native-reanimated`

I upgraded my React Native project to Gradle 7.0.2 and now when I open Android Studio it says No variants found for ':react-native-reanimated'. I'm using react-native-reanimated#1.13.3, and from the documentation for versions 1.x.x there's no real configuration, so I'm not sure how to approach this.
Has anyone run into anything similar? I'm using react-native#0.63.4, gradle 7.0.2, and Android Gradle Plugin 7.0.0.
You need to downgrade your Gradle version 7 to 6 because somehow Gradle 7 not work with react-native-reanimated 1.13.3. You can downgrade the version from gradle-wrapper.properties file like below:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip

Ionic Capacitor Barcode Scanner

I'm building android app using ionic4 and capacitor. I intent to use phonegap-plugin-barcodescanner in my app. But after installing that plugins, I began to fail building my apk. The hint I get from my Android Studio IDE is, that my app gradle using 'com.android.support:appcompat-v7:28.0.0', and the cordova gradle using "com.android.support:support-v4:27.+". I've tried to edit the cordova gradle to v4:28.0.0 (In Android Studio IDE), but still not working. What should I do?
My stack is:
node.js 6.4.1
ionic 4.12.0
angular 7.3.9
capacitor 1.0
and plugins phonegap-plugin-barcodescanner ^8.1.0
Could you show us the build.gradle files entirely?
I installed the plug-in on my project with Capacitor, and there was no problem.
Remove the plug-in, and do these steps :
npm install phonegap-plugin-barcodescanner
npm install #ionic-native/barcode-scanner
ionic cap sync
from https://ionicframework.com/docs/native/barcode-scanner
I was dealing with issues using android and not androidX, so I did then :
Refactor --> Migrate to AndroidX --> No Backup --> Do Refactor
Then do Build --> Rebuild Project
This worked for me

Camera and Geolocation plugin issue with cordova android 6.3.0

I'm facing a issue after upgrading cordova android project to version 6.3.0 in using Camera and Geolocation plugin. These both plugin uses Permission helper class which requires cordova-plugin-compat. But with cordova android version 6.3.0 release cordova-plugin-compat is no longer supported (
https://cordova.apache.org/news/2017/09/22/plugins-release.html) as it is included in the core. But I'm getting error on resolving org.apache.cordova.PermissionHelper and in org.apache.cordova.BuildHelper . How to solve this issue.
Update cordova-plugin-compat to v1.2, which contains a restriction preventing the plugin files being deployed to cordova-android#6.3.0+:
cordova plugin rm cordova-plugin-compat --force
&& cordova plugin add cordova-plugin-compat#1.2

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