I want to use this library for my project and I got error when I try open this library (FloatingActionButton) source from Github.
I download as zip this project when I tried to open the source code to understand it, I got this error:
Error:(10, 0) Could not find property 'VERSION_CODE' on project ':library'.
Add build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
versionCode Integer.parseInt(project.VERSION_CODE)
versionName project.VERSION_NAME
}
buildTypes {
release {
minifyEnabled false
debuggable false
}
debug {
minifyEnabled false
debuggable true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
apply from: '../gradle-mvn-push.gradle'
import library as a module, change versionCode
and versionName
to random values,
add a reference to your project - add to dependencies
compile project(":library")
and remove:
apply from: '../gradle-mvn-push.gradle'
To use new design support library yout need to write following line in your app's gradle file
compile 'com.android.support:design:22.2.0'
and in your layout.xml file write following lines
<android.support.design.widget.FloatingActionButton
android:id="@+id/floating_action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/your_icon"
app:borderWidth="0dp"
app:layout_anchor="@id/coordinator_layout"
app:layout_anchorGravity="bottom|right|end"
/>
Thats it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With