callstack / react-native-builder-bob

👷‍♂️ Simple set of CLIs to scaffold and build React Native libraries for different targets
https://callstack.github.io/react-native-builder-bob/
2.78k stars 184 forks source link

Cannot install a Android library which is deployed in Github Packages. #540

Closed siva-optim closed 7 months ago

siva-optim commented 7 months ago

Description

I have published my android library with access control.

I tried to install it in a sample React Native CLI project it is working fine.

But i tried to install the same android library in "create-react-native-library" project.

I am getting the below error

FAILURE: Build failed with an exception.

Steps I have done:

Added below code to ./android/build.gradle file in repositories { mavenCentral() ++ maven { ++ url = uri("https://maven.pkg.github.com/OWNER/REPOSITORY") ++ credentials { ++ username = "USERNAME" ++ password = "TOKEN" ++ } } } dependencies { ... implementation('GROUP_ID:ARTIFACT_ID:VERSION') }

Packages

Selected options

Selected options:

Link to repro

Not Yet Published

Environment

Environment:

satya164 commented 7 months ago

Repositories should be included in the app's build.gradle file, which means example/android/app/build.gradle for your repo and android/app/build.gradle for consumers.

siva-optim commented 7 months ago

Repositories should be included in the app's build.gradle file, which means example/android/app/build.gradle for your repo and android/app/build.gradle for consumers.

May I ask why ? And my requirement is to wrap up native android sdk with react native library for React Native support.

satya164 commented 7 months ago

Repositories should be included in the app's build.gradle file, which means example/android/app/build.gradle for your repo and android/app/build.gradle for consumers.

May I ask why ?

And my requirement is to wrap up native android sdk with react native library for React Native support.

Because that's how it works on Android.

siva-optim commented 7 months ago

Repositories should be included in the app's build.gradle file, which means example/android/app/build.gradle for your repo and android/app/build.gradle for consumers.

May I ask why ? And my requirement is to wrap up native android sdk with react native library for React Native support.

Because that's how it works on Android.

Could you please provide a detailed answer. what are the issues we will face if we add this feature i asked ?

satya164 commented 7 months ago

Repositories should be included in the app's build.gradle file, which means example/android/app/build.gradle for your repo and android/app/build.gradle for consumers.

May I ask why ?

And my requirement is to wrap up native android sdk with react native library for React Native support.

Because that's how it works on Android.

Could you please provide a detailed answer.

what are the issues we will face if we add this feature i asked ?

Android uses Gradle build system. You need to do it how it works on Gradle on Android. We don't determine how it works. You'll need to ask Gradle developers to add this feature.