Azure-Samples / communication-services-ui-library-react-native

UI library sample for React Native Bridge
MIT License
10 stars 10 forks source link

AzureCommunicationUIDemoApp/node_modules/react-native/react.gradle' as it does not exist. #31

Closed FaizanChoudhary closed 1 month ago

FaizanChoudhary commented 6 months ago

Please provide us with the following information:

Minimal steps to reproduce

clone the project after npm i move to android folder and just run ./gradlew build or ./gradlew update

Any log messages given by the failure

'AzureCommunicationUIDemoApp/node_modules/react-native/react.gradle' as it does not exist.'

Expected/desired behavior

OS and Version?

Using mac M1

Versions

Version 13.5.1

Mention any other details that might be useful

After successfully cloning the project using npm i, I proceeded to the android folder and executed the command ./gradlew build or ./gradlew update as mentioned in docs. However, I encountered an error stating "Could not find react-native/react.gradle' in 'AzureCommunicationUIDemoApp/node_modules/react-native/react.gradle' as it does not exist." at following directory "(/communication-services-ui-library-react-native/AzureCommunicationUIDemoApp/android/app/build.gradle:84)" line code is : 'apply from: "../../node_modules/react-native/react.gradle"'

Despite attempting npm i multiple times and changing the node version and deleting node_modules again & again, I consistently face this error, preventing the android build from running successfully.

Here is my package.json file :

{ "name": "azurecommunicationuidemoapp", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@react-native-picker/picker": "2.5.1", "@react-navigation/native": "^6.1.9", "@react-navigation/native-stack": "^6.9.15", "react": "18.2.0", "react-native": "0.72.6", "react-native-picker-select": "^8.1.0", "react-native-safe-area-context": "^4.7.3", "react-native-screens": "^3.26.0" }, "devDependencies": { "@babel/core": "^7.23.2", "@babel/runtime": "^7.23.2", "@react-native-community/eslint-config": "^3.2.0", "babel-jest": "^29.7.0", "eslint": "8.51.0", "jest": "^29.7.0", "metro-react-native-babel-preset": "^0.77.0", "react-test-renderer": "18.2.0" }, "jest": { "preset": "react-native" } }


Thanks! We'll be in touch soon.

FaizanChoudhary commented 6 months ago

@iaulakh Could you kindly assist me with resolving this issue?

ShaunaSong commented 5 months ago

Hello @FaizanChoudhary

The removal of react.gradle in React Native version 0.72, as noted in the React Native Changelog for v0.72.0, would explain the issue you are encountering. Since you are using React Native version 0.72.6, the reference to react.gradle in your app/build.gradle file is causing the error, as this file no longer exists in the React Native framework starting from version 0.72. To address this issue, you could comment out or remove the line that applies react.gradle in your app/build.gradle file. Please let us know if you meet any other issues.

Thanks.

FaizanChoudhary commented 5 months ago

Thank you for your response @ShaunaSong

after comment out the line which produces previous error "module not found" apply from: "../../node_modules/react-native/react.gradle"

i again got failure to build app in my android studio and found the list of errors here is the log i got after that between "///"

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Task :app:mergeDebugNativeLibs FAILED

FAILURE: Build completed with 10 failures.

1: Task failed with an exception.

2: Task failed with an exception.

3: Task failed with an exception.

4: Task failed with an exception.

5: Task failed with an exception.

6: Task failed with an exception.

7: Task failed with an exception.

8: Task failed with an exception.

9: Task failed with an exception.

10: Task failed with an exception.

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.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s 74 actionable tasks: 70 executed, 4 up-to-date

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Screenshot 2024-01-23 at 5 56 41 PM

please reply what can i do next to resolve this issues or suggest me which react-native version is needed to run this project correctly. One thing more "react-native": "0.72.6", is in the package.json file of this repo i didn’t specify this version by my own.

FaizanChoudhary commented 5 months ago

Hello @ShaunaSong @erikstmartin, I hope this message finds you well. I've tested the provided code and noticed that the iOS version of the Teams meeting works fine on React Native version 0.72.6, but the Android version encounters issues on the same version. I decided to downgrade React Native to version 0.69.4 using npm install --force. However, during the build process, I encountered Gradle errors, so I updated it to version 7.2.2, and the Android meeting functionality started working correctly. Now, the problem is that the iOS pods are not installing, and they are compatible with React Native version 0.72.6. I would appreciate any suggestions or additional information you can provide on resolving the issue.

iOS Issue (React Native 0.69.4): Encounter pod installation issues with React Native version 0.69.4.

[!] Invalid Podfile file: undefined method `prepare_react_native_project!' for #.

Android Issue (React Native 0.72.6): Android encounters problems on React Native version 0.72.6.

Current Challenge (React Native 0.69.4): With React Native at version 0.69.4, Android works, but iOS pods are not installing. The pods are compatible with React Native version 0.72.6.

Thank you for your assistance.

iaulakh commented 5 months ago

Hi @FaizanChoudhary,

Thank you for attempting to address this issue by using a different version of React Native. Could you please try with the latest React Native version available at https://www.npmjs.com/package/react-native/v/0.73.3?

Meanwhile, our team will also work on updating the samples to the latest React Native versions and will share updates.

Mohtasim commented 4 months ago

Hi @FaizanChoudhary,

Please refer to the branch release/1.6.0.

This branch's React-Native version is 0.69. You would be able to run both Android & iOS samples without any of the issues you have mentioned above.

Android: As you have mentioned that Android builds fine as expected. iOS: With update to iOS 17, you might face following issues with iOS pod, "DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead"

Feel free to refer to the branch to take a look at the reference podfile. If you are unable to resolve the DT_TOOLCHAIN_DIR issue, please refer to this https://stackoverflow.com/questions/77133579/dt-toolchain-dir-cannot-be-used-to-evaluate-library-search-paths-use-toolchain.

For further assistance, please take a look at our Troubleshooting Guide

Thank you :)

Mohtasim commented 2 months ago

Hi again @FaizanChoudhary,

We have upgraded our sample which is working on React-Native version 0.72.14. The underlaying UI-Library SDK being used is still version 1.6.0

The new upgraded sample solves the build issues and can be found and tested at main branch. Feel free to test that out and please reach out if you face any other issues.

Thank you. :)

Mohtasim commented 2 months ago

Hi again @FaizanChoudhary,

We have upgraded our sample which is working on React-Native version 0.72.14. The underlaying UI-Library SDK being used is still version 1.6.0

The new upgraded sample solves the build issues and can be found and tested at main branch. Feel free to test that out and please reach out if you face any other issues.

Thank you. :)