Importing library android studio



嘿,伙计们,我一直试图在android studio上导入这个库,我只是做不到。有没有人可以指导我如何导入这个库。

链接:https://github.com/rey5137/material

应用gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

应用:gradle

apply plugin: 'com.android.application'
android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0"
    defaultConfig {
        applicationId "com.projects.jeet.materialUI"
        minSdkVersion 15
        targetSdkVersion 22
        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 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.github.rey5137:material:1.2.1.6-SNAPSHOT'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:cardview-v7:22.2.1'
}

现在我得到一个错误在我的值-v23.xml

<resources>
    <!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-release/frameworks/support/v7/appcompat/res/values-v23/styles_base_text.xml -->
    <eat-comment/>
    <style name="Base.TextAppearance.AppCompat.Widget.Button.Inverse" parent="android:TextAppearance.Material.Widget.Button.Inverse"/>
    <!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-release/frameworks/support/v7/appcompat/res/values-v23/themes_base.xml -->
    <eat-comment/>
    <style name="Base.Theme.AppCompat" parent="Base.V23.Theme.AppCompat"/>
    <style name="Base.Theme.AppCompat.Light" parent="Base.V23.Theme.AppCompat.Light"/>
    <style name="Base.V23.Theme.AppCompat" parent="Base.V22.Theme.AppCompat">
        <!-- We can use the platform drawable on v23+ -->
        <item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item>
        <item name="controlBackground">@drawable/abc_control_background_material</item>
    </style>
    <style name="Base.V23.Theme.AppCompat.Light" parent="Base.V22.Theme.AppCompat.Light">
        <!-- We can use the platform drawable on v23+ -->
        <item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item>
        <item name="controlBackground">@drawable/abc_control_background_material</item>
    </style>
    <!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-release/frameworks/support/v7/appcompat/res/values-v23/styles_base.xml -->
    <eat-comment/>
    <style name="Base.Widget.AppCompat.Button.Colored" parent="android:Widget.Material.Button.Colored"/>
</resources>

错误是

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:AndroidDevKitsdkbuild-tools23.0.0aapt.exe'' finished with non-zero exit value 1

如repo中所述,将此依赖项添加到您的build.gradle

dependencies {
   compile 'com.github.rey5137:material:1.2.1'
}

将此依赖项添加到构建中。应用文件夹等级:

repositories {
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots"
    }
}

在构建中添加这些依赖项。在你的应用文件夹中评分:

dependencies {
   compile 'com.github.rey5137:material:1.2.1.6-SNAPSHOT'
   compile 'com.android.support:appcompat-v7:22.2.1'
   compile 'com.android.support:cardview-v7:22.2.1'
}

相关内容

  • 没有找到相关文章

最新更新