[問題] import github project 到自己的project

作者: t3825288 (猩爺可以了)   2018-12-11 01:16:11
我想要使用 這個 github的project
https://github.com/PhilJay/MPAndroidChart/
參造他所提供的 MPChartExample 來寫code
但是裡面會使用到 MPChartLib 的一些 function
請問我要怎麼把這個 folder import 到我的 project
我使用的是 Android Studio 平台開發
看這的解答是要在 app/build.grade 加入
https://github.com/PhilJay/MPAndroidChart/issues/26
但是會出現
Project with path ':MPChartLib' could not be found in project ':app'.
請問需要把 MPChartLib這個folder放到哪個目錄下呢
這個 lib 沒有辦法像下面這樣寫就可以從網站上download下來嗎
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'
作者: zcbxvsdf (東北一頭羊)   2018-12-11 09:18:00
放在project第一層就可以settings.gradle 加入 include 'MPChartLib'build.gradle 的dependencies 加入implementation project (':MPChartLib')以上是你自己Download他的library的import方式第二,你是要透過gradle下載的話" target="_blank" rel="nofollow">
你maven url有加嗎?沒加找不到庫
作者: t3825288 (猩爺可以了)   2018-12-12 00:37:00
謝謝解答!我是使用第一種方法,加入之後遇到這個問題More than one file was found with OS independent pat'META-INF/proguard/androidx-annotations.pro'後來在 build.gradle(app) 的 android {}中加入這行解決packagingOptions { exclude 'META-INF/proguard/androidx-annotations.pro' }

Links booklink

Contact Us: admin [ a t ] ucptt.com