how to import your own github forked library into android studio











up vote
9
down vote

favorite
2












I found a nice open library on GitHub, I imported it into my Android Studio project using Gradle dependencies, but then I realized I need to make little modifications on it.



So I forked the library on my GitHub, done the modifications and asked for a pull request, but I can't wait until they approve and merge my modifications with the original code.



Is there a way to use dependencies to import my forked library (in my Github) into my Android Studio project, rather than the original library?










share|improve this question


















  • 1




    I have the same problem, but all i can think of is Import as Module way , since you have it in your disk. I know this isnt the solution your looking for but I think this is the only way(I think) as of now.
    – david
    Jan 22 '16 at 6:20

















up vote
9
down vote

favorite
2












I found a nice open library on GitHub, I imported it into my Android Studio project using Gradle dependencies, but then I realized I need to make little modifications on it.



So I forked the library on my GitHub, done the modifications and asked for a pull request, but I can't wait until they approve and merge my modifications with the original code.



Is there a way to use dependencies to import my forked library (in my Github) into my Android Studio project, rather than the original library?










share|improve this question


















  • 1




    I have the same problem, but all i can think of is Import as Module way , since you have it in your disk. I know this isnt the solution your looking for but I think this is the only way(I think) as of now.
    – david
    Jan 22 '16 at 6:20















up vote
9
down vote

favorite
2









up vote
9
down vote

favorite
2






2





I found a nice open library on GitHub, I imported it into my Android Studio project using Gradle dependencies, but then I realized I need to make little modifications on it.



So I forked the library on my GitHub, done the modifications and asked for a pull request, but I can't wait until they approve and merge my modifications with the original code.



Is there a way to use dependencies to import my forked library (in my Github) into my Android Studio project, rather than the original library?










share|improve this question













I found a nice open library on GitHub, I imported it into my Android Studio project using Gradle dependencies, but then I realized I need to make little modifications on it.



So I forked the library on my GitHub, done the modifications and asked for a pull request, but I can't wait until they approve and merge my modifications with the original code.



Is there a way to use dependencies to import my forked library (in my Github) into my Android Studio project, rather than the original library?







github android-studio gradle android-gradle android-library






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 26 '15 at 17:33









avafab

5041522




5041522








  • 1




    I have the same problem, but all i can think of is Import as Module way , since you have it in your disk. I know this isnt the solution your looking for but I think this is the only way(I think) as of now.
    – david
    Jan 22 '16 at 6:20
















  • 1




    I have the same problem, but all i can think of is Import as Module way , since you have it in your disk. I know this isnt the solution your looking for but I think this is the only way(I think) as of now.
    – david
    Jan 22 '16 at 6:20










1




1




I have the same problem, but all i can think of is Import as Module way , since you have it in your disk. I know this isnt the solution your looking for but I think this is the only way(I think) as of now.
– david
Jan 22 '16 at 6:20






I have the same problem, but all i can think of is Import as Module way , since you have it in your disk. I know this isnt the solution your looking for but I think this is the only way(I think) as of now.
– david
Jan 22 '16 at 6:20














4 Answers
4






active

oldest

votes

















up vote
3
down vote



accepted










I know that this is an old post, but for someone with similar problem, if you simply want a way to change a lib and use it in your project, you can download the lib code, change it and import into your project as a module:




  1. Open your project in Android Studio

  2. Download the library (using Git, or a zip archive to unzip)

  3. Go to File > New > Import Module and import the library as a module

  4. Right-click your app in project view and select "Open Module Settings"

  5. Click the "Dependencies" tab and then the '+' button

  6. Select "Module Dependency"

  7. Select the imported module

  8. Open your build.gradle file and check that the module is listed under dependencies.






share|improve this answer




























    up vote
    1
    down vote













    I think the previous answers are both outdated. There is actually a really easy way to do this nowadays: jitpack.io



    All you need to do is.



    1) add in your root build.gradle at the end of allprojects repositories:



    allprojects {
    repositories {
    ...
    maven { url 'https://jitpack.io' }
    }
    }


    2) Add the dependency in your app build.gradle:



    dependencies {
    implementation 'com.github.User:Repo:Tag'
    }


    If you don't have any releases/tags, you can also just do com.github.User:Repo:branchname-SNAPSHOT to build from the latest commit on that branch.






    share|improve this answer




























      up vote
      0
      down vote













      You need to add your own git respository as remote. You can't however do this within Android Studio, according to this thread. Use the command line instead:



      git remote add remoteName remoteUrl
      git fetch remoteName


      Then you can go to Android Studio, VCS > Git > Pull and select your added remote repository.






      share|improve this answer



















      • 5




        I think you didn't get my question. I have a fork of the library in my github and it is modified. In my android studio project I imported the original library using Gradle dependencies which is without the modifications I made. Is there a way to use dependency to import the modified version of the library which is in my github?
        – avafab
        Feb 26 '15 at 20:18


















      up vote
      0
      down vote













      This is how you should do it:




      • Fork the repo.

      • make changes and commit them

      • edit the push urls to your github forked repository.

      • make a release/tag

      • head over to jitpack.io

      • generate a url to add to your gradle file






      share|improve this answer























        Your Answer






        StackExchange.ifUsing("editor", function () {
        StackExchange.using("externalEditor", function () {
        StackExchange.using("snippets", function () {
        StackExchange.snippets.init();
        });
        });
        }, "code-snippets");

        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "1"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f28749014%2fhow-to-import-your-own-github-forked-library-into-android-studio%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        3
        down vote



        accepted










        I know that this is an old post, but for someone with similar problem, if you simply want a way to change a lib and use it in your project, you can download the lib code, change it and import into your project as a module:




        1. Open your project in Android Studio

        2. Download the library (using Git, or a zip archive to unzip)

        3. Go to File > New > Import Module and import the library as a module

        4. Right-click your app in project view and select "Open Module Settings"

        5. Click the "Dependencies" tab and then the '+' button

        6. Select "Module Dependency"

        7. Select the imported module

        8. Open your build.gradle file and check that the module is listed under dependencies.






        share|improve this answer

























          up vote
          3
          down vote



          accepted










          I know that this is an old post, but for someone with similar problem, if you simply want a way to change a lib and use it in your project, you can download the lib code, change it and import into your project as a module:




          1. Open your project in Android Studio

          2. Download the library (using Git, or a zip archive to unzip)

          3. Go to File > New > Import Module and import the library as a module

          4. Right-click your app in project view and select "Open Module Settings"

          5. Click the "Dependencies" tab and then the '+' button

          6. Select "Module Dependency"

          7. Select the imported module

          8. Open your build.gradle file and check that the module is listed under dependencies.






          share|improve this answer























            up vote
            3
            down vote



            accepted







            up vote
            3
            down vote



            accepted






            I know that this is an old post, but for someone with similar problem, if you simply want a way to change a lib and use it in your project, you can download the lib code, change it and import into your project as a module:




            1. Open your project in Android Studio

            2. Download the library (using Git, or a zip archive to unzip)

            3. Go to File > New > Import Module and import the library as a module

            4. Right-click your app in project view and select "Open Module Settings"

            5. Click the "Dependencies" tab and then the '+' button

            6. Select "Module Dependency"

            7. Select the imported module

            8. Open your build.gradle file and check that the module is listed under dependencies.






            share|improve this answer












            I know that this is an old post, but for someone with similar problem, if you simply want a way to change a lib and use it in your project, you can download the lib code, change it and import into your project as a module:




            1. Open your project in Android Studio

            2. Download the library (using Git, or a zip archive to unzip)

            3. Go to File > New > Import Module and import the library as a module

            4. Right-click your app in project view and select "Open Module Settings"

            5. Click the "Dependencies" tab and then the '+' button

            6. Select "Module Dependency"

            7. Select the imported module

            8. Open your build.gradle file and check that the module is listed under dependencies.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 12 at 7:02









            Johny

            1089




            1089
























                up vote
                1
                down vote













                I think the previous answers are both outdated. There is actually a really easy way to do this nowadays: jitpack.io



                All you need to do is.



                1) add in your root build.gradle at the end of allprojects repositories:



                allprojects {
                repositories {
                ...
                maven { url 'https://jitpack.io' }
                }
                }


                2) Add the dependency in your app build.gradle:



                dependencies {
                implementation 'com.github.User:Repo:Tag'
                }


                If you don't have any releases/tags, you can also just do com.github.User:Repo:branchname-SNAPSHOT to build from the latest commit on that branch.






                share|improve this answer

























                  up vote
                  1
                  down vote













                  I think the previous answers are both outdated. There is actually a really easy way to do this nowadays: jitpack.io



                  All you need to do is.



                  1) add in your root build.gradle at the end of allprojects repositories:



                  allprojects {
                  repositories {
                  ...
                  maven { url 'https://jitpack.io' }
                  }
                  }


                  2) Add the dependency in your app build.gradle:



                  dependencies {
                  implementation 'com.github.User:Repo:Tag'
                  }


                  If you don't have any releases/tags, you can also just do com.github.User:Repo:branchname-SNAPSHOT to build from the latest commit on that branch.






                  share|improve this answer























                    up vote
                    1
                    down vote










                    up vote
                    1
                    down vote









                    I think the previous answers are both outdated. There is actually a really easy way to do this nowadays: jitpack.io



                    All you need to do is.



                    1) add in your root build.gradle at the end of allprojects repositories:



                    allprojects {
                    repositories {
                    ...
                    maven { url 'https://jitpack.io' }
                    }
                    }


                    2) Add the dependency in your app build.gradle:



                    dependencies {
                    implementation 'com.github.User:Repo:Tag'
                    }


                    If you don't have any releases/tags, you can also just do com.github.User:Repo:branchname-SNAPSHOT to build from the latest commit on that branch.






                    share|improve this answer












                    I think the previous answers are both outdated. There is actually a really easy way to do this nowadays: jitpack.io



                    All you need to do is.



                    1) add in your root build.gradle at the end of allprojects repositories:



                    allprojects {
                    repositories {
                    ...
                    maven { url 'https://jitpack.io' }
                    }
                    }


                    2) Add the dependency in your app build.gradle:



                    dependencies {
                    implementation 'com.github.User:Repo:Tag'
                    }


                    If you don't have any releases/tags, you can also just do com.github.User:Repo:branchname-SNAPSHOT to build from the latest commit on that branch.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Sep 8 at 17:20









                    user8118328

                    476




                    476






















                        up vote
                        0
                        down vote













                        You need to add your own git respository as remote. You can't however do this within Android Studio, according to this thread. Use the command line instead:



                        git remote add remoteName remoteUrl
                        git fetch remoteName


                        Then you can go to Android Studio, VCS > Git > Pull and select your added remote repository.






                        share|improve this answer



















                        • 5




                          I think you didn't get my question. I have a fork of the library in my github and it is modified. In my android studio project I imported the original library using Gradle dependencies which is without the modifications I made. Is there a way to use dependency to import the modified version of the library which is in my github?
                          – avafab
                          Feb 26 '15 at 20:18















                        up vote
                        0
                        down vote













                        You need to add your own git respository as remote. You can't however do this within Android Studio, according to this thread. Use the command line instead:



                        git remote add remoteName remoteUrl
                        git fetch remoteName


                        Then you can go to Android Studio, VCS > Git > Pull and select your added remote repository.






                        share|improve this answer



















                        • 5




                          I think you didn't get my question. I have a fork of the library in my github and it is modified. In my android studio project I imported the original library using Gradle dependencies which is without the modifications I made. Is there a way to use dependency to import the modified version of the library which is in my github?
                          – avafab
                          Feb 26 '15 at 20:18













                        up vote
                        0
                        down vote










                        up vote
                        0
                        down vote









                        You need to add your own git respository as remote. You can't however do this within Android Studio, according to this thread. Use the command line instead:



                        git remote add remoteName remoteUrl
                        git fetch remoteName


                        Then you can go to Android Studio, VCS > Git > Pull and select your added remote repository.






                        share|improve this answer














                        You need to add your own git respository as remote. You can't however do this within Android Studio, according to this thread. Use the command line instead:



                        git remote add remoteName remoteUrl
                        git fetch remoteName


                        Then you can go to Android Studio, VCS > Git > Pull and select your added remote repository.







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited May 23 '17 at 12:13









                        Community

                        11




                        11










                        answered Feb 26 '15 at 17:47









                        Darek Kay

                        9,11244350




                        9,11244350








                        • 5




                          I think you didn't get my question. I have a fork of the library in my github and it is modified. In my android studio project I imported the original library using Gradle dependencies which is without the modifications I made. Is there a way to use dependency to import the modified version of the library which is in my github?
                          – avafab
                          Feb 26 '15 at 20:18














                        • 5




                          I think you didn't get my question. I have a fork of the library in my github and it is modified. In my android studio project I imported the original library using Gradle dependencies which is without the modifications I made. Is there a way to use dependency to import the modified version of the library which is in my github?
                          – avafab
                          Feb 26 '15 at 20:18








                        5




                        5




                        I think you didn't get my question. I have a fork of the library in my github and it is modified. In my android studio project I imported the original library using Gradle dependencies which is without the modifications I made. Is there a way to use dependency to import the modified version of the library which is in my github?
                        – avafab
                        Feb 26 '15 at 20:18




                        I think you didn't get my question. I have a fork of the library in my github and it is modified. In my android studio project I imported the original library using Gradle dependencies which is without the modifications I made. Is there a way to use dependency to import the modified version of the library which is in my github?
                        – avafab
                        Feb 26 '15 at 20:18










                        up vote
                        0
                        down vote













                        This is how you should do it:




                        • Fork the repo.

                        • make changes and commit them

                        • edit the push urls to your github forked repository.

                        • make a release/tag

                        • head over to jitpack.io

                        • generate a url to add to your gradle file






                        share|improve this answer



























                          up vote
                          0
                          down vote













                          This is how you should do it:




                          • Fork the repo.

                          • make changes and commit them

                          • edit the push urls to your github forked repository.

                          • make a release/tag

                          • head over to jitpack.io

                          • generate a url to add to your gradle file






                          share|improve this answer

























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            This is how you should do it:




                            • Fork the repo.

                            • make changes and commit them

                            • edit the push urls to your github forked repository.

                            • make a release/tag

                            • head over to jitpack.io

                            • generate a url to add to your gradle file






                            share|improve this answer














                            This is how you should do it:




                            • Fork the repo.

                            • make changes and commit them

                            • edit the push urls to your github forked repository.

                            • make a release/tag

                            • head over to jitpack.io

                            • generate a url to add to your gradle file







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 11 at 13:54









                            Xenolion

                            2,78531028




                            2,78531028










                            answered Nov 11 at 12:50









                            Job M

                            6010




                            6010






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f28749014%2fhow-to-import-your-own-github-forked-library-into-android-studio%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                鏡平學校

                                ꓛꓣだゔៀៅຸ໢ທຮ໕໒ ,ໂ'໥໓າ໼ឨឲ៵៭ៈゎゔit''䖳𥁄卿' ☨₤₨こゎもょの;ꜹꟚꞖꞵꟅꞛေၦေɯ,ɨɡ𛃵𛁹ޝ޳ޠ޾,ޤޒޯ޾𫝒𫠁သ𛅤チョ'サノބޘދ𛁐ᶿᶇᶀᶋᶠ㨑㽹⻮ꧬ꧹؍۩وَؠ㇕㇃㇪ ㇦㇋㇋ṜẰᵡᴠ 軌ᵕ搜۳ٰޗޮ޷ސޯ𫖾𫅀ल, ꙭ꙰ꚅꙁꚊꞻꝔ꟠Ꝭㄤﺟޱސꧨꧼ꧴ꧯꧽ꧲ꧯ'⽹⽭⾁⿞⼳⽋២៩ញណើꩯꩤ꩸ꩮᶻᶺᶧᶂ𫳲𫪭𬸄𫵰𬖩𬫣𬊉ၲ𛅬㕦䬺𫝌𫝼,,𫟖𫞽ហៅ஫㆔ాఆఅꙒꚞꙍ,Ꙟ꙱エ ,ポテ,フࢰࢯ𫟠𫞶 𫝤𫟠ﺕﹱﻜﻣ𪵕𪭸𪻆𪾩𫔷ġ,ŧآꞪ꟥,ꞔꝻ♚☹⛵𛀌ꬷꭞȄƁƪƬșƦǙǗdžƝǯǧⱦⱰꓕꓢႋ神 ဴ၀க௭எ௫ឫោ ' េㇷㇴㇼ神ㇸㇲㇽㇴㇼㇻㇸ'ㇸㇿㇸㇹㇰㆣꓚꓤ₡₧ ㄨㄟ㄂ㄖㄎ໗ツڒذ₶।ऩछएोञयूटक़कयँृी,冬'𛅢𛅥ㇱㇵㇶ𥄥𦒽𠣧𠊓𧢖𥞘𩔋цѰㄠſtʯʭɿʆʗʍʩɷɛ,əʏダヵㄐㄘR{gỚṖḺờṠṫảḙḭᴮᵏᴘᵀᵷᵕᴜᴏᵾq﮲ﲿﴽﭙ軌ﰬﶚﶧ﫲Ҝжюїкӈㇴffצּ﬘﭅﬈軌'ffistfflſtffतभफɳɰʊɲʎ𛁱𛁖𛁮𛀉 𛂯𛀞నఋŀŲ 𫟲𫠖𫞺ຆຆ ໹້໕໗ๆทԊꧢꧠ꧰ꓱ⿝⼑ŎḬẃẖỐẅ ,ờỰỈỗﮊDžȩꭏꭎꬻ꭮ꬿꭖꭥꭅ㇭神 ⾈ꓵꓑ⺄㄄ㄪㄙㄅㄇstA۵䞽ॶ𫞑𫝄㇉㇇゜軌𩜛𩳠Jﻺ‚Üမ႕ႌႊၐၸဓၞၞၡ៸wyvtᶎᶪᶹစဎ꣡꣰꣢꣤ٗ؋لㇳㇾㇻㇱ㆐㆔,,㆟Ⱶヤマފ޼ޝަݿݞݠݷݐ',ݘ,ݪݙݵ𬝉𬜁𫝨𫞘くせぉて¼óû×ó£…𛅑הㄙくԗԀ5606神45,神796'𪤻𫞧ꓐ㄁ㄘɥɺꓵꓲ3''7034׉ⱦⱠˆ“𫝋ȍ,ꩲ軌꩷ꩶꩧꩫఞ۔فڱێظペサ神ナᴦᵑ47 9238їﻂ䐊䔉㠸﬎ffiﬣ,לּᴷᴦᵛᵽ,ᴨᵤ ᵸᵥᴗᵈꚏꚉꚟ⻆rtǟƴ𬎎

                                Why https connections are so slow when debugging (stepping over) in Java?