【发布时间】:2017-06-28 02:54:33
【问题描述】:
我尝试创建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
}
但我又遇到了那个错误!
请帮帮我。
【问题讨论】: