1

I try to start an this Android Studio app.

when I open app with android studio I got this error:

No service of type Factory available in ProjectScopeServices

I am new to android studio But I try solved this with seachring:

My android studio version is 2.2.3 and Android SDK tools: 25.2.5./tools version:25.0.2

I extract app and edit it for work my android studio version:

old build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:1.0.0'
    classpath 'com.github.dcendents:android-maven-plugin:1.2'

}

I read this and changed it to this:

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath 'com.github.dcendents:android-maven-plugin:1.2'
    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}

I also changed gradle.properties to this:

VERSION_NAME=1.2.0
VERSION_CODE=22
GROUP=com.daimajia.swipelayout

ANDROID_BUILD_MIN_SDK_VERSION=16
ANDROID_BUILD_TARGET_SDK_VERSION=25
ANDROID_BUILD_SDK_VERSION=25
ANDROID_BUILD_TOOLS_VERSION=25.0.2

Also change demo/build.gradle to this:

dependencies {
    compile project(":library")
    compile 'com.android.support:recyclerview-v7:21.0.0'
    compile 'com.daimajia.easing:library:1.0.0@aar'
    compile 'com.daimajia.androidanimations:library:1.1.2@aar'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'jp.wasabeef:recyclerview-animators:1.0.3@aar'
}

And finally change library/build.gradle

apply plugin: 'com.android.library'

android {
    compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
    buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
    }
}

dependencies {
    compile 'com.android.support:recyclerview-v7:25.1.1'
    compile 'com.android.support:support-v4:25.+'
}
apply from: './gradle-mvn-push.gradle'

apply plugin: 'android-maven'
// build a jar with source files
task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}
artifacts {
    archives sourcesJar
}

But I get that error again!

please help me.

Community
  • 1
  • 1
Maral
  • 99
  • 1
  • 4
  • 10
  • Possible duplicate of [No service of type Factory available in ProjectScopeServices](https://stackoverflow.com/questions/38825451/no-service-of-type-factory-available-in-projectscopeservices) – meshkati Jun 17 '19 at 06:37

5 Answers5

3

change dependency of project build.gradle file

classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

This is worked for me

Ankur Bavishi
  • 943
  • 12
  • 14
0

Modify your build.gradle file

Here is an example:

No service of type Factory available in ProjectScopeServices

You need to include the maven grade plugin, as shown in the link.

Community
  • 1
  • 1
JordanH
  • 190
  • 5
0

choose the correct version of "android-maven-gradle-plugin", https://github.com/dcendents/android-maven-gradle-plugin

hyman
  • 1
0

Change or include below gradle plugin latest version to 1.4.1 in your main project build.gradle file

dependencies {
    classpath 'com.android.tools.build:gradle:2.2.2'
    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}

this is work for me...

Pankaj Talaviya
  • 3,328
  • 28
  • 31
0

No service of type Factory available in ProjectScopeServices

You should use below in PROJECT level build.gradle

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

And include apply plugin tag in your APP Level build.gradle.

apply plugin: 'com.github.dcendents.android-maven'
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198