Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve gradle transitive dependency with credentials?

I'm currently has two Android project, SDK and App. In SDK there's several dependencies stores in my private artifactory, which need credentials to access. I put the credential in SDK's gradle file.

In App layer, when I try to pull the SDK and transitively solve the dependencies, I can't get access to those dependencies. It's like gradle don't even know to look up these dependencies in my artifactory. Btw, other dependencies in SDK which pull from maven or Jcenter works just fine.

So how could I solve this thing? These dependencies are third party so I can't put them on public. Please help me about it if you know how. Very thanks to you.

like image 976
Ray Avatar asked Nov 27 '25 04:11

Ray


1 Answers

You have to add the repository with credential also in your app module.

 repositories {
        jcenter()
        maven {
            credentials {
                username 'xxxx'
                password 'xxxxx'
            }
            url 'xxxx'
        }

Since some dependencies are located in the private repository you have to add this url to the repository block in the module.
It can't know the credentials.

like image 194
Gabriele Mariotti Avatar answered Nov 28 '25 18:11

Gabriele Mariotti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!