@Evermillion

Как пофиксить проблему при компиляции?

Я не совсем шарю в Android Studio, Kotlin и Gradle, мне нужно просто собрать плагин SDK RuStore для Godot.
Пытаюсь собрать плагин для Godot 4.2.2 по инструкции, но получаю следующую ошибку при выполнении команды

gradle assemble

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':RuStoreGodotCore:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 6s


Вот содержимое основного build.gradle
ext {
    rustore_core_version = '1.0.0'
    rustore_pushclient_version = '2.+'
    rustore_sdk_type = ''
    //rustore_pushclient_version = '1.4.0'
    //rustore_sdk_type = '-QA'
    sdk_version_code = 1
    rustore_qa_dir = "${rootProject.projectDir}/../../QA"
}
buildscript {
    ext.kotlin_version = "1.7.10"
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://artifactory-external.vkpartner.ru/artifactory/maven")
        }
        maven {
            url uri("$rustore_qa_dir/repo")
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

afterEvaluate {
    def folder = file(rustore_qa_dir)
    if (!folder.exists()) rustore_sdk_type = ''
}


build.gradle модуля RuStoreGodotCore
plugins {
    id 'com.android.library'
    id 'kotlin-android'
}

android {
    compileSdkVersion 33
    buildToolsVersion "30.0.3"

    defaultConfig {
        minSdkVersion 24
        targetSdkVersion 33
        versionCode sdk_version_code
        versionName "${rustore_core_version}"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation "com.google.code.gson:gson:2.10.1"
    implementation "androidx.fragment:fragment:1.3.0"
    compileOnly fileTree(dir: '../libs', include: ['*.aar', '*.jar'], exclude: [])
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

task copyAARGodot(type: Copy) {
    from    ( [buildDir.absolutePath, 'outputs', 'aar'].join(File.separator) )
    include ( "${project.name}-release.aar" )
    into    ( [rootDir.absolutePath, '..', 'godot_example', 'android', 'plugins', 'RuStoreGodotCore' ].join(File.separator) )
    rename  ("${project.name}-release.aar", "${project.name}.aar")
}

task generateGdapFile {
    doLast {
        def content = """[config]
name="${project.name}"
binary_type="local"
binary="${project.name}/${project.name}.aar"

[dependencies]
custom_maven_repos=["https://artifactory-external.vkpartner.ru/artifactory/maven", "../../../../QA/repo"]
remote=["com.google.code.gson:gson:2.10.1"]
"""

        def outputFile = file("../../godot_example/android/plugins/${project.name}.gdap")

        outputFile.parentFile.mkdirs()
        outputFile.write(content)
    }
}

afterEvaluate {
    assembleRelease.finalizedBy('copyAARGodot')
    assembleRelease.finalizedBy('generateGdapFile')
}


build.gradle модуля RuStoreGodotPush
plugins {
    id 'com.android.library'
    id 'kotlin-android'
}

android {
    compileSdkVersion 33
    buildToolsVersion "30.0.3"

    defaultConfig {
        minSdkVersion 24
        targetSdkVersion 33
        versionCode sdk_version_code
        versionName "${rustore_pushclient_version}"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

ext {
    sdk_lib_dependence = "ru.rustore.sdk:pushclient:$rustore_pushclient_version$rustore_sdk_type"
}

dependencies {

    implementation "$sdk_lib_dependence"
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation "com.google.code.gson:gson:2.10.1"
    implementation "androidx.fragment:fragment:1.3.0"
    implementation project(path: ':RuStoreGodotCore')
    compileOnly fileTree(dir: '../libs', include: ['*.aar', '*.jar'], exclude: [])
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

task copyAARGodot(type: Copy) {
    from    ( [buildDir.absolutePath, 'outputs', 'aar'].join(File.separator) )
    include ( "${project.name}-release.aar" )
    into    ( [rootDir.absolutePath, '..', 'godot_example', 'android', 'plugins', "${project.name}" ].join(File.separator) )
    rename  ("${project.name}-release.aar", "${project.name}.aar")
}

task generateGdapFile {
    doLast {
        def content = """[config]
name="${project.name}"
binary_type="local"
binary="${project.name}/${project.name}.aar"

[dependencies]
remote=["$sdk_lib_dependence", "androidx.appcompat:appcompat:1.5.0"]
"""

        def outputFile = file("../../godot_example/android/plugins/${project.name}.gdap")

        outputFile.parentFile.mkdirs()
        outputFile.write(content)
    }
}

afterEvaluate {
    assembleRelease.finalizedBy('copyAARGodot')
    assembleRelease.finalizedBy('generateGdapFile')
}


Версия Gradle в Path - 7.3.2

Вот результат команды gradle assemble --stacktrace

Вот результат команды gradle assemble --info
  • Вопрос задан
  • 74 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы