在新的android studio中打开旧项目时出错

时间:2018-12-14 18:09:31

标签: android android-studio

我在旧版本的Android Studio中有一个android项目。我重新安装了Windows,然后安装了最新版本的Android Studio。 现在,当我打开或导入我的项目时,我会遇到此错误:

No service of type Factory<LoggingManagerInternal> available in ProjectScopeServices.
Open File

当我单击错误下方的“打开文件”链接时,它会将我定向到

apply plugin: 'com.github.dcendents.android-maven'

这是我的项目build.gradle:

apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'

version = '0.0.6'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile files('libs/chunk-templates-3.0.1.jar')
    compile 'com.android.support:appcompat-v7:23.1.1'
}

def siteUrl = 'https://github.com/kexanie/MathView'
def gitUrl = 'https://github.com/kexanie/MathView.git'
group = 'io.github.kexanie.library'

install {
    repositories.mavenInstaller {
        // This generates POM.xml with proper parameters
        pom {
            project {
                packaging 'aar'

                // Add your description here
                name 'A library for displaying math formula in Android apps.'
                url siteUrl

                // Set your license
                licenses {
                    license {
                        name 'The Apache Software License, Version 2.0'
                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    }
                }
                developers {
                    developer {
                        id 'kexanie'
                        name 'Brian Lee'
                        email 'kexanie@gmail.com'
                    }
                }
                scm {
                    connection gitUrl
                    developerConnection gitUrl
                    url siteUrl

                }
            }
        }
    }
}

dependencies {
}

task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}

task javadoc(type: Javadoc) {
    source = android.sourceSets.main.java.srcDirs
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}
artifacts {
    archives javadocJar
    archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
    user = properties.getProperty("bintray.user")
    key = properties.getProperty("bintray.apikey")

    configurations = ['archives']
    pkg {
        repo = "maven"
        name = "MathView"
        websiteUrl = siteUrl
        vcsUrl = gitUrl
        licenses = ["Apache-2.0"]
        publish = true
    }
}

这是build.gradle应用模块:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "mathtools.user.com.mathtools"
        minSdkVersion 17
        targetSdkVersion 23
        versionCode 9
        versionName "2.4"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile project(':MathView')
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.google.android.gms:play-services-appindexing:8.1.0'
    compile 'com.androidplot:androidplot-core:0.9.8'
    compile 'com.android.support:design:23.4.0'
    compile 'com.android.support:support-v4:23.4.0'
}

我该怎么办?

1 个答案:

答案 0 :(得分:0)

在项目build.gradle文件中将maven gradle插件版本更改为1.4.1

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