【发布时间】:2015-08-15 15:17:18
【问题描述】:
Eclipse 是我构建 Android 应用程序的地方,目前我无法切换到 Android Studio。
我需要在操作栏上添加小循环倒计时。我正在尝试使用 github 上提供的 CircleProgress 库,但问题是它使用 gradle,我不知道 Gradle 是什么。我在这里尝试了几个步骤,例如制作 java 文件夹源或创建新库,但它们都不起作用。
错误显示为解析 XML 时出错:未绑定前缀
我的布局文件来源:-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="@dimen/activity_vertical_margin"
android:weightSum="10" >
<LinearLayout
android:id="@+id/llcount"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="0.5"
android:background="@color/Black"
android:baselineAligned="false"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imgQuit"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:padding="2dp"
android:src="@drawable/quit_icon" />
<com.youth4work.prepapp.CustomTextViewFont
android:id="@+id/txtquesno"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="6"
android:gravity="center"
android:text="Daily Test - Q1/Q20"
android:textColor="@color/White"
android:textSize="@dimen/text_size" />
<com.youth4work.prepapp.CustomTextViewFont
android:id="@+id/txttimer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/White"
android:textSize="@dimen/text_size" />
<ProgressBar
android:id="@+id/barTimer"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="fill_parent"
android:progressDrawable="@drawable/circular_progress_bar" />
<com.github.lzyzsd.circleprogress.DonutProgress //Error over here
android:layout_marginLeft="50dp"
android:id="@+id/donut_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
custom:donut_progress="30"/>
</LinearLayout>
<!-- Further Code and then closed Main LinearLayout -->
帮我解决这个问题。
另外,如果有人可以为我提供关于什么是 gradle 以及为什么我们必须使用它的良好参考,这将很有帮助,以便我下次可以做好准备。
编辑
这是我的 builds.gradle
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
dependencies {
compile 'com.github.lzyzsd:circleprogress:1.1.0@aar'
}
version = "1.2.0"
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 10
targetSdkVersion 21
versionCode 5
versionName version
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
def siteUrl = 'https://github.com/lzyzsd/CircleProgress'
def gitUrl = 'https://github.com/lzyzsd/CircleProgress.git'
group = "com.github.lzyzsd.circleprogress"
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'Circle Progress, Donut Progress, Arc Progress'
url siteUrl
// Set your license
licenses {
license {
name 'MIT'
url 'http://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'lzyzsd'
name 'Bruce Lee'
email 'bruceinpeking@gmail.com'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven"
name = "CircleProgress"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["MIT"]
publish = true
}
}
【问题讨论】:
-
像其他人一样使用 Android Studio。
-
@JaredBurrows 我首先提到了一些事情。如果您知道提供它的答案,请不要浪费您和我的时间。
标签: java android eclipse gradle android-library