Unable to add Minim-Android library in Android Studio with jitpack - android

I am trying to add to my build.gradle file in Android Studio the following dependency:
https://android-arsenal.com/details/1/1883
I followed the intstructions found in package tab of this page, but when I tried to build the project I got the following message:
Error:(32, 13) Failed to resolve:
com.github.DASAR:Minim-Android:a73b596916
Anyone can help me?
I also tried to download the project code and import it in Android Studio as a module, but it wasn't recognized as a library from the wizard.
Thank you all in advance.

You can download relative API in your AS SDK Manager, then add it in build.gradle. After that, check out the compileSdkVersion, targetSdkVersion are same with appcompat. My build.gradle is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.0.1"
defaultConfig {
applicationId "com.example.android"
minSdkVersion 9
targetSdkVersion 19
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:19.0.0'
}
my sdk is 19

Best option is to fork the project and add a Gradle build file. Then use JitPack to build the fork.
Note that the project has dependencies in a libs/ folder so these would need to be converted to dependencies in Gradle.

Related

How to change build tools version in Android Studio

I have a problem using jfeinstein10 Sliding Menu
I added the library into my root project folder. But I get this error :
Error:The SDK Build Tools revision (17.0.0) is too low for project
':SlidingMenu'. Minimum required is 19.1.0
But I'm already using "19.1.0" but it still says I'm using 17.0.0
Here is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.repliklernet.replikler"
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 group:'com.squareup.picasso', name:'picasso', version:'2.5.0'
compile project(':SlidingMenu')
}
What am I missing ?
If you look at the build.gradle file for the library, you can see that it references build tools 17: https://github.com/jfeinstein10/SlidingMenu/blob/master/library/build.gradle#L17
You need to update that line.
The error is actually giving you a hint by mentioning project ':SlidingMenu', referring to the project SlidingMenu.
Right click on the project folder and choose 'Open Module Setings'
Select 'app' on the Modules List(Left pane)
Select 'Properties' tab and will present you with 'Compile SDK Version', 'Build Tools Version'.
Click OK
Reference : https://www.youtube.com/watch?v=v4b7C6Q-9dI
You should change the build.gradle within your library

Error including library htmlCleaner

I'm a beginner in android developing whith Android Studio.
I'm trying to include the htmlcleaner library in my project, but when I rebuild the project, Android Studio return this Error
Error: COnfiguration whit name 'default' not found
I added in the root folder of my project the library folder, so I added this line in settings.gradle
include ':htmlcleaner'
and this line in build.gradle
compile project (':htmlcleaner')
Is there anyone who can help me? thanks
to include many informations, I post the build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.rob_company_domain.sunshine"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile project (':htmlcleaner')
}
If you want to add your htmlcleaner library to your project in Android studio, you can do it in three standard ways. Please read this link https://stackoverflow.com/a/35369267/5475941. In this post I explained how to import your JAR files in Android studio and I explained all possible ways step by step with screenshots. I hope it helps.

how to use marshmallow in Android studio

I am using Android studio and i want to use Marshmallow API and AppCompatActivity. When I created a new project the build.gradle contained the below lines but I receive error at R class which says not a symbol.
Please let me know how to correct the build.gradle to get the App work.
gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.com.myapplication"
minSdkVersion 19
targetSdkVersion 23
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:23.0.1'
}
Click on Build->Clean Project and that will perform a gradle clean
Update your Android SDK Manager Install all component of Android 6.0 (API 23)
R file can be erased due to many reasons, try rebuilding your project(which is the most common issue) and other issues may include any syntax error or inappropriate file permissions in work space, the exact error report can help address the issue better.

Failed to find: com.android.support:support-v4:22.2.0

I am trying to do an application but there seems to be some error with the gradle files now. It was working fine until I upgraded the support libraries.
I was working with api 21 which worked fine, but then i upgraded to api22 and changed the gradle files accordingly.. Now this error shows up.
Error:Failed to find: com.android.support:support-v4:22.2.0
This is my current gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.sampleapp"
minSdkVersion 12
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.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.jakewharton:butterknife:6.1.0'
}
Any help would be appreciated.
If this might help someone, after MANY trials and errors, I found that I was targeting the wrong SDK version (an older one) in the build.gradle file corresponding to "library". To change this you can do it by hand or go to the Module Settings Menu (right click on your project folder -> Open Module Settings. Then in "library" - Properties you can change the Compile Sdk and the Build Tools Versions
Using Android SDK Manager. Go to Extras and then Android Support Repository and update it to the latest version.
(This is essentially the comment #natario made, but it should be an answer.)

Adding 3rd Party Code to my Android Studio Project

I'm having issues when I try to use Bindroid in my Android Studio Project. I've set up a boilerplate app to create a HelloWorld example using Bindroid. I cloned the Bindroid source into my /libs folder. But when I go to run my app, I get a package Bindroid does not exist error.
I need to know how to import this code and use it with my project. For example, where should I place this code? How do I configure my project to use it? Here's my project structure:
EDIT
So I've added Bindroid according to the instructions, here is the resulting structure:
And here is my apps build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.sg.spencergardner.finance5"
minSdkVersion 9
targetSdkVersion 21
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:21.0.3'
compile project(':Bindroid:Bindroid')
}
And my project's settings.gradle:
include ':app'
include ":Bindroid"
You need to copy all the contents of this https://github.com/depoll/bindroid/tree/master/Bindroid under the folder name "Bindroid".
In your app's build.gradle, add.
compile project(':Bindroid:Bindroid')
:Bindroid:Bindroid corresponds to "Project Folder":"App/Library Folder". See https://github.com/depoll/bindroid/blob/master/BindroidSample/build.gradle#L5.
Also in your settings.gradle, you need to add ":app" and ":Bindroid".

Categories

Resources