如何在Android Studio中构建旧的Android项目

如何在Android Studio中构建旧的Android项目,android,android-studio,gradle,sony,Android,Android Studio,Gradle,Sony,我找到了一份旧的git回购协议。 这是索尼系统相机的Android应用程序 它适用于Android SDK 10 可在以下位置找到该项目: 我无法在最新版本的Android Studio中构建它。我已将详细信息添加到以下问题: 我希望这里有更多的人可以帮助我,回购协议最后一次更新是在2018年。我更改了以下文件,它对我来说运行良好(你需要根据你的android studio版本使用Gradle插件,我的版本是3.4) gradle wrapper.properties #Sun Jul 21

我找到了一份旧的git回购协议。 这是索尼系统相机的Android应用程序

它适用于Android SDK 10

可在以下位置找到该项目:

我无法在最新版本的Android Studio中构建它。我已将详细信息添加到以下问题:


我希望这里有更多的人可以帮助我,回购协议最后一次更新是在2018年。

我更改了以下文件,它对我来说运行良好(你需要根据你的android studio版本使用Gradle插件,我的版本是3.4)

gradle wrapper.properties

#Sun Jul 21 00:42:34 IST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
build.gradle顶级

    buildscript {
        repositories {
            jcenter()
            google()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.4.0'
        }
    }

    allprojects {
        repositories {
            google()
            jcenter()
            maven {
                url "https://jitpack.io"
            }
        }
    }
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
//    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.github.ma1co.pmcademo.app"
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

//    compileOptions {
//        sourceCompatibility JavaVersion.VERSION_1_6
//        targetCompatibility JavaVersion.VERSION_1_6
//    }
}

//android.applicationVariants.all { variant ->
//    variant.outputs.each { output ->
//        def apkName = "PMCADemo-${output.baseName}-${variant.versionName}.apk"
//        output.outputFile = new File(output.outputFile.parent, apkName)
//    }
//}

dependencies {
    implementation 'com.github.ma1co.OpenMemories-Framework:framework:-SNAPSHOT'
    compileOnly 'com.github.ma1co.OpenMemories-Framework:stubs:-SNAPSHOT'
    implementation 'com.nanohttpd:nanohttpd:2.1.1'
}
build.gradle应用程序级别

    buildscript {
        repositories {
            jcenter()
            google()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.4.0'
        }
    }

    allprojects {
        repositories {
            google()
            jcenter()
            maven {
                url "https://jitpack.io"
            }
        }
    }
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
//    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.github.ma1co.pmcademo.app"
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

//    compileOptions {
//        sourceCompatibility JavaVersion.VERSION_1_6
//        targetCompatibility JavaVersion.VERSION_1_6
//    }
}

//android.applicationVariants.all { variant ->
//    variant.outputs.each { output ->
//        def apkName = "PMCADemo-${output.baseName}-${variant.versionName}.apk"
//        output.outputFile = new File(output.outputFile.parent, apkName)
//    }
//}

dependencies {
    implementation 'com.github.ma1co.OpenMemories-Framework:framework:-SNAPSHOT'
    compileOnly 'com.github.ma1co.OpenMemories-Framework:stubs:-SNAPSHOT'
    implementation 'com.nanohttpd:nanohttpd:2.1.1'
}
这是我的输出


您是否尝试过将
versionCode
中的命令替换为40之类的数字,并将
versionName
替换为一个伪数字,然后尝试同步gradle?是的,然后我又遇到了一个错误:/我可以明天发布结果。我已经在SDK管理器中安装了SDK10和gradle构建版本,但是没有结果。我也可以通过这些更改来构建应用程序,谢谢,但是相机需要一个SDK版本为10的Android应用程序。有没有办法回到版本10?我刚刚将SDKVersions更改为10,apk也在处理相机。