'Android add Library error
Hello i use a Cropper library i add a project with android wizards but in xml mark a error
import com.edmodo.cropper.CropImageView;
CropImageView crop_image_view;
work fine ok import my 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>
Rendering Problems NOTE This project contains Java compilation errors which can cause rendering failures for custom views Fix compilation problems first
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 java.io.StringReader@eb8d000)
my 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')
}
where ir my error?
Solution 1:[1]
Have you tried with adding dependency like below:
compile 'com.edmodo:cropper:1.0.1'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | halfer |
