2015-01-20 50 views
3

你好,我使用了跟頭庫我添加了一個項目與Android嚮導,但在XML標記錯誤的Android添加庫錯誤

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> 

渲染問題注意該項目包含Java編譯錯誤,這些錯誤會導致自定義視圖呈現失敗首先修復編譯問題

The following classes could not be instantiated: 
- com.edmodo.cropper.CropImageView (Open Class, Show Exception) 
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details org.xmlpull.v1.XmlPullParserException: name expected (position:START_TAG <null>@4:59 in [email protected]) 

我gradlie:

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') 
} 

其中IR我的錯誤?

回答

0

你有沒有嘗試添加像下面的依賴:

compile 'com.edmodo:cropper:1.0.1' 

請您嘗試一下,並檢查它。

Enjoy Coding ... :)