I am trying to add mikepenz's Material Drawer as third party project. The reason I want to add it as project (not by just compile as dependency) so that I can modify the drawer's UI as per my requirement. But I cannot sync my gradle successfully and getting the following error:
Failed to resolve:project :Library:materialDrawer
Here is my project structure:
-> root
->app
->Library
-> materialDrawer
-> app
-> build.gradle
-> settings.gradle
-> build.gradle(project)
-> settings.gradle
I tried to follow this project https://github.com/foragerr/android-multi-project-sample/blob/master/settings.gradle But in vein.
Here is my build.gradle(My project) file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.novoda:bintray-release:0.3.4'
}
}
allprojects {
repositories {
maven {
url 'https://maven.google.com'
}
jcenter()
}
}
settings.gradle (My project)
include ':app', ':Library:materialDrawer'
build.gradle (app : My project)
apply plugin: 'com.android.application'
apply plugin: 'android'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.******"
minSdkVersion 15
targetSdkVersion 25
versionCode 38
versionName "2.1.8"
generatedDensities = []
}
dexOptions {
javaMaxHeapSize "4g"
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
tasks.whenTaskAdded { task ->
if (task.name.equals("lint")) {
task.enabled = false
}
}
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
/*
compile('com.mikepenz:materialdrawer:5.6.0#aar') {
transitive = true
}
*/
compile project(':Library:materialDrawer')
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:support-v4:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'com.android.support:cardview-v7:25.0.1'
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.google.android.gms:play-services-location:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-crash:10.2.0'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5#aar'
compile 'com.github.ParkSangGwon:TedPermission:v1.0.12'
compile 'hanks.xyz:smallbang-library:0.1.2'
compile 'com.yalantis:ucrop:2.2.0'
compile 'com.github.clans:fab:1.6.4'
compile 'me.zhanghai.android.materialratingbar:library:1.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.0'
}
apply plugin: 'com.google.gms.google-services'
build.gradle (Project : materialDrawer)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.novoda:bintray-release:0.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url 'https://maven.google.com'
}
jcenter()
}
}
My Android Studio is v2.3.3. I'm scratching my head but couldn't find any solution. Please someone help me I'm stuck with this for three days...
Since you are using:
compile project(':Library:materialDrawer')
gradle is looking for a build.gradle inside that module.
Checking your question, this file exists but it is a top-level file instead of a module file.
You should change structure in this way (you should not put the library folder inside another module)
-> root
->app
-> build.gradle
->Library
-> materialDrawer
-> app
-> build.gradle
-> build.gradle
-> settings.gradle
-> build.gradle(project)
-> settings.gradle
You have to change the settings.gradle with:
include ':app', ':materialDrawer'
project(':materialDrawer').projectDir = new File('/Library/materialDrawer/app')
Then as dependency use:
compile project(':materialDrawer')
Related
My build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.3-2'
ext.realm_version = '3.7.2'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
classpath "io.realm:realm-gradle-plugin:$realm_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven { url 'https://dl.bintray.com/jetbrains/anko' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
repositories {
mavenCentral()
}
My app/build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
realm {
syncEnabled = true;
}
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
dexOptions {
jumboMode = true
}
defaultConfig {
applicationId "com.my.project"
minSdkVersion 15
targetSdkVersion 23
versionCode 54
versionName "1.3.54"
multiDexEnabled true
}
}
def AAVersion = '4.3.1'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.0#aar') {
transitive = true;
}
compile('com.digits.sdk.android:digits:1.11.0#aar') {
transitive = true;
}
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.baoyz.swipemenulistview:library:1.3.0'
compile 'com.google.android.gms:play-services-gcm:11.0.4'
compile 'com.google.code.gson:gson:2.7'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.3'
compile 'com.squareup.okhttp:okhttp:2.7.3'
compile 'com.theartofdev.edmodo:android-image-cropper:2.2.5'
compile 'commons-codec:commons-codec:1.9'
compile 'commons-io:commons-io:2.4'
compile 'io.realm:android-adapters:2.0.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.apache.httpcomponents:httpcore:4.4.4'
compile 'org.apache.httpcomponents:httpmime:4.3.6'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'us.feras.mdv:markdownview:1.1.0'
compile 'org.jetbrains.anko:anko-sdk15:0.9.1'
compile "org.androidannotations:androidannotations-api:$AAVersion"
// for annotaions
kapt "io.realm:realm-android-library:$realm_version"
kapt "org.androidannotations:androidannotations:$AAVersion"
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile "com.android.support:design:26.1.0"
compile "com.android.support:customtabs:26.1.0"
compile "com.android.support:cardview-v7:26.1.0"
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
When I build I get error:
Error:Execution failed for task ':app:processDevGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
com\my_project\app\src\dev\google-services.json
com\my_project\\app\google-services.json
OK.In Android Studio select menu: Tools->Friebase
Firebase-> Authentification
Click on Email and password authentification
Connect to your app to Firebase
and get error:
Could not parse the Android Application module
I've just resolve this problem.
I was upgrading the old GCM to FCM, and the Firebase Assistant shows the same error message as yours.
Solved by:
Go to Firebase console, in the Settings of my project, download google-servics.json to app/ folder. (Replace my old GCM's json file)
doing Add Firebase to your app again,
Then I can use the Firebase Assistans of AndroidStudio, again.
For me, the issue was classpath 'com.google.gms:google-services:4.3.0' was giving error, then I changed to classpath 'com.google.gms:google-services:4.2.0', resync'd Project with Gradle Files', then pressed Connect to firebase, :D
You might want to try 'Sync Project with Gradle Files'.
Sometimes I forget to sync the implementations after adding them to the gradle file.
I know that there is so many question regarding this, but I have tried all solution from StackOverflow but still I did not resolve this issue
my app level build.gradle files is
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.aple.gole.video"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "0.1"
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id: "a1bdfc88-fffb-4283-9c45-8a15b3bbd3a2",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:customtabs:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.code.gson:gson:2.7'
compile 'org.jsoup:jsoup:1.8.3'
compile 'org.mozilla:rhino:1.7.7'
compile 'ch.acra:acra:4.9.0'
compile 'info.guardianproject.netcipher:netcipher:1.2'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.github.nirhart:parallaxscroll:1.0'
compile 'com.nononsenseapps:filepicker:3.0.0'
compile 'com.google.android.exoplayer:exoplayer:r2.4.2'
compile ('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile ('com.onesignal:OneSignal:[3.5.3,4.0.0)') {
exclude group: 'com.google.android.gms', module: 'play-services'
}
compile 'com.github.varunest:sparkbutton:1.0.5'
compile 'com.google.firebase:firebase-database:11.0.2'
}
apply plugin: 'com.google.gms.google-services'
I started to get this issue when I used this
apply plugin: 'com.google.gms.google-services'
but it required for firebase
my project level build.gradle is
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven { url "https://jitpack.io" }
}
}
From External Library I have found different version of Google Play Service
Might be that will crate problem, let me share you screenshot
please click here to check screenshot
but now problem is why there is different version of Google Play Service, One is Play Service iid 10.0.1 and other one is play service task 11.0.2
,How to make it same
Hi I have found that you
compile 'com.google.firebase:firebase-database:11.0.2'
is using
google-play-service lib 11.0.2
You can do this
compile 'com.google.firebase:firebase-database:10.0.1'
so it will use
google-play-service lib 10.0.1
it will work, I have tested
I want add this dependencies compile 'com.github.ar-android:DrawRouteMaps:1.0.0' into my Android studio Project.
When add this into dependencies and click on Sync show me this error :
Error:(39, 13) Failed to resolve: com.github.ar-android:DrawRouteMaps:1.0.0
Show in File<br>Show in Project Structure dialog
build.gradle codes:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.example.mohammadn.a1_maptutorial"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.google.android.gms:play-services:9.2.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.google.android.gms:play-services-maps:9.2.1'
testCompile 'junit:junit:4.12'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.6.1'
compile 'com.github.ar-android:DrawRouteMaps:1.0.0'
}
How can I fix it and add this library into my dependencies?
Add support jitpact repository in root build.gradle at the end of repositories:
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
Read official guideline about DrawRouteMaps .
Add this to your project: build.gradle file to this
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
Try adding following lines to project/build.gradle (not app/build.gradle)
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
app/build.gradle
compile 'com.github.ar-android:DrawRouteMaps:1.0.0'
First, you have to add the Maven Repository in your project:
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
And then, add dependencies in build.gradle module app :
dependencies {
compile 'com.github.ar-android:DrawRouteMaps:1.0.0'
}
In addition to above comments you can add dependencies in file->project structure-> add->+(plus sign)->add library
Hi Am trying to configure Jenkins in android studio. I followed this link
and i installed Jenkins in MAC system and verified with my localhost to check its running perfectly or not(as mentioned in the above link).
I have added following line in my project(root) dependency.
classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1'
My updated project .gradle file is
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
No issues while sync project .gradle file.
But the problem starts after updating(adding robolectric) app .gradle file
apply plugin: 'com.android.application'
apply plugin: 'org.robolectric'
this gives me the following error message
Gradle 'CreatrixAndApp' project refresh failed
Error:The Android Gradle plugin 2.1.2 is not supported.
this is my project root .gradle file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1'
}
}
allprojects {
repositories {
jcenter()
}
}
this is my app .gradle file
apply plugin: 'com.android.application'
apply plugin: 'org.robolectric'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
repositories {
mavenCentral()
maven {
url "${System.env.HOME}/.m2/repository"
}
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId 'com.creatrixhrm'
minSdkVersion 16
targetSdkVersion 23
versionCode 20160615
versionName "1.6.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':photoViewerLibrary')
compile project(':multipleImagePick')
compile(name: 'creatrixone1_1', ext: 'aar')
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:support-vector-drawable:23.3.0'
compile 'com.android.support:animated-vector-drawable:23.3.0'
compile 'com.koushikdutta.ion:ion:2.1.7'
compile 'mbanje.kurt:fabbutton:1.2.2#aar'
compile 'com.google.code.gson:gson:2.4'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'io.jsonwebtoken:jjwt:0.6.0'
}
I tried following this suggestion, but no use
can anyone tell me where i am making mistake
Developing app with Android studio using gradle. I have added this dependencies to it:
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.google.code.gson:gson:2.3.1'
but it says :
Error:A problem occurred configuring project ':app'.
> Could not download gson.jar (com.google.code.gson:gson:2.3.1)
> Could not get resource 'https://jcenter.bintray.com/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar'.
> Could not GET 'https://jcenter.bintray.com/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar'.
> Connection to https://jcenter.bintray.com refused
Full source for my build.gradle files
Project:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
App:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "domain.myapplication"
minSdkVersion 11
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'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.google.code.gson:gson:2.3.1'
}
Define this in you gradle build script.
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
...
}
}
allprojects {
repositories {
mavenCentral()
}
}
Call mavenCentral() in your build.gradle .
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.3'
}
add maven repository to build.gradle
Failed to resolve: com.google.code.gson:gson:2.3.1