2015-10-05 90 views
1

嗨,我試圖從github實現第三方庫。這有點瘋狂。我已經與第三方libarys經常合作。我所要做的只是在構建gradle中添加編譯命令,但在這種情況下,它有些不同。這是LIB GitHub的鏈接我想要實現:Android第三方集成

Link to github

的問題是我不能夠訪問這個庫的所有組件。只有到了文件com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.0:[email protected]

但在類ExpandableExampleActivity我必須導入:

import com.h6ah4i.android.example.advrecyclerview.R; 
import com.h6ah4i.android.example.advrecyclerview.common.data.AbstractExpandableDataProvider; 
import com.h6ah4i.android.example.advrecyclerview.common.fragment.ExampleExpandableDataProviderFragment; 

,但我不能。我可以看到github上的目錄中的文件!

有人可以幫助我如何整合這個最好的方法。 THX

buildscript { 
    repositories { 
     maven { url 'https://raw.github.com/xujiaao/mvn-repository/master/releases' } 
    } 

    dependencies { 
     classpath 'com.github.xujiaao:aarLinkSources:1.0.0' 
    } 
} 

apply plugin: 'com.android.application' 
apply plugin: 'aar-link-sources' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.0 rc3" 

    defaultConfig { 
     applicationId "android.oli.com.fitnessapp" 
     minSdkVersion 16 
     targetSdkVersion 21 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:23.0.1' 
    compile 'com.android.support:design:23.0.1' 
    compile 'com.android.support:recyclerview-v7:23.0.1' 
    compile 'com.android.support:cardview-v7:23.0.1' 
    compile 'com.github.sundeepk:compact-calendar-view:1.7.8' 

    compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:[email protected]'){ 
     transitive=true 
    } 
    aarLinkSources 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.0:[email protected]' 
} 
+0

這實際上是關於「R包方和遞歸分區partykit」? –

+0

什麼?我不明白這一點。我只想成功整合整個圖書館。 – XxGoliathusxX

+0

XxGoliathusxX:您指定了「派對」標籤,其摘要包含引用的@AndyTurner文本。 (我已經刪除了標籤。) – fadden

回答

1

至於我看到,如果你只需要導入的三個文件,

import com.h6ah4i.android.example.advrecyclerview.R; 
import com.h6ah4i.android.example.advrecyclerview.common.data.AbstractExpandableDataProvider; 
import com.h6ah4i.android.example.advrecyclerview.common.fragment.ExampleExpandableDataProviderFragment; 

然後剛剛從GitHub的項目最後兩個文件複製到自己。 R文件將在構建項目時自動生成。我沒有看到這兩個文件依賴於其他文件,所以它應該工作。

+0

就像我說:我沒有訪問到com.h6ah4i.android.EXAMPLE。而上面的輸入只是例子。我需要更多。 – XxGoliathusxX

+0

夥計,它在github文件夾中,我有權訪問,所以你應該也有! – varunkr

+0

其全部標記爲紅色灰色。當我進口東西,寫一個。沒有示例 – XxGoliathusxX