0
我想在Android Studio上添加來自https://github.com/aectann/socratica-android/tree/master/libraries/image-map的ImageMap庫。 這是我app/build.gradle
Gradle同步完成..但拋出java.lang.ClassNotFoundException
apply plugin: 'com.android.application'
repositories{
mavenCentral()
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "PACKAGE"
minSdkVersion 14
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.2.1'
compile 'com.socratica.mobile:image-map:[email protected]'
}
它完成成功同步,並把庫外部庫,而是試圖參照com.socratica.mobile.ImageMap時拋出ClassNotFoundException的。 和佈局XML文件..
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.socratica.mobile.ImageMap
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/usamap"
app:map="@xml/usamap"
app:selectionPadding="50dp"
app:selectionColor="#f00"
app:selectionType="stroke"
app:selectionStrokeWidth="2"
android:id="@+id/map"/>
</RelativeLayout>
你的幫助是非常讚賞。
是,哈利right..there可能在你的xml文件的某個地方出現錯誤。請閱讀後面的xml代碼以獲得更清楚的理解。 – Droidwala