How to Import Github non Android Studio Project as library into Android Studio? -


i trying import standout library github project library in project.what tried below:

  • created folder in root project directory named 'libs'

    • copied complete folder 'library' of standout project on git 'libs'
    • renamed folder 'library' copied e.g. "standout" (just avoid confusion)
    • now added library in settings.gradle following command:

      include ':libs:standout'

    • going build.gradle file of appproject , added following line 'dependencies':

      compile project(':libs:standout')

    • but got error , added

       compile filetree(dir: 'libs', include: ['standout']) 

gradle sync successful there red mark on src files of library project.enter image description here.
i couldn't access library src files mainactivity of project.as github project wasn't android studio project need that?

i have tried below way suggested wesley:

download or clone git repository, copy library folder project root folder.

then in project settings.gradle file, add ':library' @ end of include line, this: include ':app', ':library', gradle sync whole project.

at end, in app module or own application module, edit build.gradle file, add line in dependencies:

compile project(':library')

btw, can change folder name ("library" in case) name want (like "standout-library" if want) when copy project's root folder, then, when edit gradle files, use changed name.

but got below error:

error:configuration name 'default' not found. 

my build.gradle:

  apply plugin: 'com.android.application'  android {     compilesdkversion 21     buildtoolsversion "21.1.2"      defaultconfig {         applicationid "com.example.mapandmap.standout"         minsdkversion 15         targetsdkversion 21         versioncode 1         versionname "1.0"     }     buildtypes {         release {             minifyenabled false             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro'         }     } }  dependencies {     compile filetree(dir: 'libs', include: ['*.jar'])     compile project(':standout')     compile 'com.android.support:appcompat-v7:22.1.1'  } 

my settings.gradle:

include ':app',':standout' 

screenshot of project tree:

enter image description here

you need resolve r in each file of "standout" library showing red now. can add doing this. go android studio file->project structure-> + , 4 options add new module. there choose "import existing project"->next-> browse directory have downloaded library , choose "library" directory , "finish".android studio take time sync library project. add dependency in settings. tested adding library in project , working perfectly. move library main "app" project better add dependency.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -