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

Issue while trying to integrate the Carbon library #196

Closed
oumaima12 opened this issue Jan 22, 2025 · 1 comment
Closed

Issue while trying to integrate the Carbon library #196

oumaima12 opened this issue Jan 22, 2025 · 1 comment

Comments

@oumaima12
Copy link

While integrating the Carbon library into my project, I followed the steps provided in the official documentation. However, I encountered and resolved a couple of issues during the process:

  1. iOS Issue: Pod Installation
    When running the pod install command, I encountered an error. This was resolved by running the following command to ensure CocoaPods was properly installed:
    sudo gem install cocoapods

  2. Android Issue: Font Assets Configuration
    While running the app on Android Studio, an issue occurred with the assets configuration. The problem arose because the assets configuration is not directly available in the android block of the build.gradle file. To fix this:

Open the android/app/build.gradle File:
Locate the android block.
Add the sourceSets Configuration:
Update the file to reference the src/main/assets/fonts directory. The final configuration should look like this:

android {
...
sourceSets {
main {
assets.srcDirs += 'src/main/assets'
}
}
}

This ensures that the fonts in src/main/assets/fonts are included in the build.

  1. Rebuilding the Android Project
    After making the adjustments, I followed these steps to clean and rebuild the project:

Clean the Project:
cd android
./gradlew clean

Rebuild the Project:
cd ..
npx react-native run-android

With these fixes, I was able to successfully set up the Carbon library and run the application on both iOS and Android.

@dabrad26
Copy link
Member

Thanks for sharing. Different versions of react native link differently. We will check and try to update the docs. But it is recommended to follow latest RN docs to accomplish setup as they are changing frequently and the CLI is in flux as of now requiring more manual changes :(

@dabrad26 dabrad26 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Carbon for React Native Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants