0

actually i have been trying to import another gradle project as library from github and i know that there are two ways to do that

1)by adding url to dependencies in build.gradle file this method gave lot of errors

2)manually download library and import it as module, then add dependencies

and i somehow succeeded by using second method ..

after that gradle sync worked correctly but while running application it gives some bizzare errors like

Error:(23, 0) Gradle DSL method not found: 'ompile()' Possible causes:

  • The project 'AppIntro' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file
  • The build file may be missing a Gradle plugin. Apply Gradle plugin
  • and the github link is as follows

    https://github.com/PaoloRotolo/AppIntro

    i imported folder called as library in that....

    Gabriele Mariotti
    • 320,139
    • 94
    • 887
    • 841
    focusing
    • 3
    • 3
    • 3
      looks like you (or someone else) misspelled `compile()` as `ompile()` ... – Shark Jan 27 '16 at 10:56
    • how do i change it and don't know where it is , because it in imported library @Shark – focusing Jan 27 '16 at 11:03
    • please post your `build.gradle` file... just it's `dependencies` block. maybe you misspelled it as `ompile 'https://github.com/PaoloRotolo/AppIntro'` – Shark Jan 27 '16 at 11:05
    • 1
      sorry and yes... it was misspelled and i corrected it... i never thought error is in my .gradle file ..as it suggested error in AppIntro Library...thanks for the time and sorry for such feeble doubt.. – focusing Jan 27 '16 at 11:17
    • no, it merely *said* that there is no `ompile()` method, and *suggested* that the AppIntro may be using a newer version of Gradle which no longer contains that method and told you to open the Gradle file. – Shark Jan 27 '16 at 12:10

    1 Answers1

    1

    You can add this library in many ways:

    • Add a simple dependency in your build.gradle file

    Just use:

    dependencies {
      compile 'com.github.paolorotolo:appintro:3.4.0'
    }
    

    Just add this repo to your build.gradle

    repositories {
            // ...
            maven { url "https://jitpack.io" }
        }
    

    And the dependency:

    dependencies {
            compile 'com.github.User:Repo:Tag'
        }
    
    • download the module (the library folder) locally.
    ʍѳђઽ૯ท
    • 16,646
    • 7
    • 53
    • 108
    Gabriele Mariotti
    • 320,139
    • 94
    • 887
    • 841
    • much obliged ......but i have very layman's doubt,there are two build.grade files what's the difference between each other... – focusing Jan 27 '16 at 11:11
    • @viru For other question I suggest you asking a new question. In this way other users can help you resolving your doubts. In any case. Each module has a build.gradle file, and there is a top-level build.gradle file. More info here: http://stackoverflow.com/questions/23241681/why-are-there-two-build-gradle-files-in-an-android-studio-project/23241888#23241888 – Gabriele Mariotti Jan 27 '16 at 11:20