【问题标题】:Android-Pdf View LibraryAndroid-Pdf 视图库
【发布时间】:2015-10-27 07:30:57
【问题描述】:

导入此库后:https://github.com/JoanZapata/android-pdfview

我收到了这个错误:

错误:SDK 构建工具版本 (19.0.3) 对项目来说太低 ':android-pdfview-sample'。最低要求是 19.1.0

所以我将 build.gradle minSdk 从 19.0.3 更改为 19.1.0 然后出现另一个错误:

错误:失败:构建失败并出现异常。

  • 出了什么问题: 在根项目“Finalariel”中找不到任务“”。

  • 尝试: 运行 gradle 任务以获取可用任务的列表。使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。

我会改变什么来解决这个问题?TIA

这是应用程序中的 build.gradle 文件:

apply plugin: 'android'
description = 'android-pdfview-sample'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"

defaultConfig {
    minSdkVersion 8
    targetSdkVersion 19
    versionCode 2
    versionName "1.0.1"
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }
}
}

dependencies {
compile project(':android-pdfview')
provided 'com.googlecode.androidannotations:androidannotations:2.7.1'
compile 'com.googlecode.androidannotations:androidannotations-api:2.7.1'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
}

库的build.gradle:

apply plugin: 'android-library'
description = 'android-pdfview'
android {
compileSdkVersion 19
buildToolsVersion '19.0.3'

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        jniLibs.srcDirs = [ 'libs' ]
    }
}
}

【问题讨论】:

  • 显示你的 gradle 文件
  • 或者给我一些其他方法来将此库导入我的新项目。我只使用项目结构添加了库,然后添加了模块依赖项。当我将 compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' 放入 build.gradle 时没有任何反应

标签: android pdf pdfviewer pdfview


【解决方案1】:

试试这个:

apply plugin: 'com.android.application'

android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"
    ...

    dependencies {
    compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-26
    • 2017-09-13
    • 1970-01-01
    相关资源
    最近更新 更多