安卓工作室 : No service of type Factory available in ProjectScopeServices

标签 android android-studio

我尝试启动一个 this Android Studio app .

当我使用 android studio 打开应用程序时出现此错误:

No service of type Factory available in ProjectScopeServices

我是 android studio 的新手,但我尝试用 seachring 解决了这个问题:

我的android studio版本是2.2.3,Android SDK工具:25.2.5./tools version:25.0.2

我提取应用程序并编辑它以用于我的 android studio 版本:

build.gradle

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

}

我读了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'
}

我还将 gradle.properties 更改为:

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

同时将 demo/build.gradle 更改为:

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'
}

最后更改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
}

但是我又遇到了那个错误!

请帮助我。

最佳答案

更改项目build.gradle文件的依赖

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

这对我有用

关于安卓工作室 : No service of type Factory available in ProjectScopeServices,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42147856/

相关文章:

android - Visual Studio Mac,已签名的 Android 版本早于当前版本

android-studio - Android Studio路径错误

android-studio - 在 iPhone 模拟器上运行 Flutter 应用时偶尔出现 IDE 错误。 FlutterApp.setLaunchMode 不能为 null

android - 如何在 Ionic 3 上播放 .MOV 视频文件?

android - Kotlin扩展函数: unresolved reference

java - 安卓工作室 : Button always appears at the front

java - 处理 AndroidStudio 中的重复条目 : java. util.zip.ZipException

javascript - 安装 Android 6.0.1 后,应用程序在调试时崩溃

android - Xamarin.Android - Java 绑定(bind)取决于 Google Play 服务

android - 找不到 'JAVA_HOME' 环境变量。尝试手动设置