【问题标题】:Include MPChartLib in Android project [duplicate]在 Android 项目中包含 MPChartLib [重复]
【发布时间】:2018-06-18 04:28:36
【问题描述】:

我已将MPChartLib library 下载为 zip 文件。我使用的是 Android Studio 1.5

【问题讨论】:

    标签: android android-library mpandroidchart


    【解决方案1】:

    Gradle 依赖(推荐)

    将以下内容添加到您的项目级别 build.gradle:

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

    将此添加到您的应用 build.gradle:

    dependencies {
        implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
    }
    

    访问MP Android Chard Usage了解更多详情

    【讨论】:

      【解决方案2】:

      在你的 build.gradle 文件中编译这个:

      compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
      
      repositories {
          maven { url "https://jitpack.io" }
      }
      

      使用 this-: 创建布局

      <com.github.mikephil.charting.charts.PieChart
              android:id="@+id/piechart"
              android:layout_width="match_parent"
              android:layout_height="match_parent"/>
      

      使用此链接作进一步参考-: https://www.studytutorial.in/android-pie-chart-using-mpandroid-library-tutorial

      【讨论】:

      • 根据 Gradle 的版本,这可能是 implementation 而不是 compile
      • 这包含在 Android 3.0 中并阅读问题可以安装 3.0 所以它是一个替代方案..
      【解决方案3】:

      只需浏览 ZIP 文件的内容,如果是 jar 文件,您可以解压缩并导入它 按 Ctrl+Alt+Shift+S 并在库菜单中选择加号

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-08-28
        • 1970-01-01
        • 1970-01-01
        • 2013-08-16
        • 2011-10-06
        • 1970-01-01
        相关资源
        最近更新 更多