React Native 0.71.1 version throws error after upgrade - react-native

I have upgraded my React Native to the latest version which is 0.71.1. After upgrading my project to the latest version it's throwing error when i try to run the project which is like:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not find com.facebook.react:react-native:0.71.1.
Required by:
project :app
project :app > project :react-native-community_slider
project :app > project :react-native-picker_picker
Now, what can i do to solve this issue ? I have deleted node module and installed again. Upgraded the dependencies too. But not sure what i need to do at this point. Thanks in advance.

I'm have problems with version of the React Native .
O Solve this with making downgrade version: using
npx react-native init ProjectName --version 0.68.2
Perhabs it help you!!

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.

How to modify Podfile in an Expo-Managed React Native project

I have implemented an app that uses react-native-branch and #config-plugins/react-native-branch with the expo-managed workflow but upon building with EAS in iOS (Expo Application Services), its throwing this error:
The Swift pod `ExpoAdapterBranch` depends upon `react-native-branch`, which does not define modules.
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries),
you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
Is there a way to do this in expo-managed workflow?
Other details of our project:
Expo SDK: v44
react-native-branch: v5.0.0
#config-plugins/react-native-branch: v1.0.2
I finally get it to build in iOS without errors by updating my react-native-branch version from 5.0.0 to 5.4.0 without any other changes to the plugin. However, expo is now giving off a warning saying that
Some dependencies are incompatible with the installed expo package version:
- react-native-branch - expected version: 5.0.0 - actual version installed: 5.4.0
If anyone has a better solution to this, I would gladly hear it. Thanks!

Error while building new react native iOS app due to glog library build error

Getting compilation errors with glog static library installed via pod. Using Xcode 12.3 and glog version is 0.3.5. Attaching a screenshot for the errors from Xcode build logs. [Xcode build error logs with new react native app]
Please provide solution for it.
you should try cleaning your build project in xcode then try to delete your podfile.lock then pod install, hope this helps.

Could not find the expo package in your project - react-native link

I have created an expo project using expo-cli and ejected it to regular native-script project, but while running react-native link I am getting this message:
Could not find the "expo" package in your project when configuring the
packager while running react-native link
can someone please help me resolving the issue.
Thanks in Advance.

Unable to run react native project due to java version 10

I have got the react native installation done but with latest jdk version that is v10.
Now when I try to run the project using the command react-native run-android, I am getting the following error,
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '10'.
I'm pretty much new to the MAC environment, How do I roll back to the previous working version of java in Mac?
How I can fix this issue?
You need a change in the Android
Gradle properties file.
PROJECT_PATH/android/gradle/wrapper/gradle-wrapper.properties
Update your distributionUrl to the following
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-rc-2-all.zip
Downgrade the Java version.
This is a problem with the latest version of java.