Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/397.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android添加库错误_Java_Android - Fatal编程技术网

Java Android添加库错误

Java Android添加库错误,java,android,Java,Android,您好,我使用裁剪器库,我添加了一个带有android向导的项目,但在xml中标记了一个错误 import com.edmodo.cropper.CropImageView; CropImageView crop_image_view; 工作正常导入 我的xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" androi

您好,我使用裁剪器库,我添加了一个带有android向导的项目,但在xml中标记了一个错误

import com.edmodo.cropper.CropImageView;
CropImageView crop_image_view;
工作正常导入 我的xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <com.edmodo.cropper.CropImageView
        xmlns:custom="http://schemas.android.com/apk/res-auto"
        android:id="@+id/crop_image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        custom:aspectRatioX="5"
        custom:showGuidelines="onTouch"
        />
</LinearLayout>
android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.example.android"
        minSdkVersion 16
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':cropper')
}

我的错误在哪里?

您是否尝试过添加依赖项,如下所示:

compile 'com.edmodo:cropper:1.0.1'
请试试看

享受编码……:)

compile 'com.edmodo:cropper:1.0.1'