簡體   English   中英

如何解決創建已簽名APK文件的問題?

[英]How can I fix my issue creating a signed APK file?

我想在Google Play商店中發布我的應用,但我未能創建所需的“app-release.apk”。 我得到的錯誤如下:

找不到org.jetbrains.trove4j:trove4j:20160824。 在以下位置搜索:

    file:/C:/Users/Albrecht/AppData/Local/Android/Sdk/extras/m2repository/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
    file:/C:/Users/Albrecht/AppData/Local/Android/Sdk/extras/m2repository/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
    file:/C:/Users/Albrecht/AppData/Local/Android/Sdk/extras/google/m2repository/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
    file:/C:/Users/Albrecht/AppData/Local/Android/Sdk/extras/google/m2repository/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
    file:/C:/Users/Albrecht/AppData/Local/Android/Sdk/extras/android/m2repository/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
    file:/C:/Users/Albrecht/AppData/Local/Android/Sdk/extras/android/m2repository/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
    file:/C:/Users/Albrecht/.m2/repository/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
    file:/C:/Users/Albrecht/.m2/repository/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
    https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
    https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
    https://oss.sonatype.org/content/repositories/snapshots/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
    https://oss.sonatype.org/content/repositories/snapshots/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
    https://oss.sonatype.org/content/repositories/releases/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
    https://oss.sonatype.org/content/repositories/releases/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
    https://maven.google.com/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
    https://maven.google.com/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
Required by:
    project :android > com.android.tools.lint:lint-gradle:26.1.4 > com.android.tools.external.com-intellij:intellij-core:26.1.4

我的build.gradle文件:

buildscript {


    repositories {
        mavenLocal()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://maven.google.com" }
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'com.google.gms:google-services:3.2.1'

    }
}

allprojects {
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = '1.0'
    ext {
        appName = "ShapeRecognisingGame"
        gdxVersion = '1.9.8'
        roboVMVersion = '2.3.3'
        box2DLightsVersion = '1.4'
        ashleyVersion = '1.7.3'
        aiVersion = '1.8.0'
    }

    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
        maven { url "https://maven.google.com" }
    }
}

project(":desktop") {
    apply plugin: "java"


    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
        compile "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"

    }
}

project(":android") {
    apply plugin: "android"

    configurations { natives }

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
        compile "com.google.android.gms:play-services-ads:15.0.1"

        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
    }
}

project(":core") {
    apply plugin: "java"


    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"

    }
}

我已經檢查了其他幾個解決此錯誤的方法。 但是,他們都沒有為我工作。

我也得到了錯誤以及LibGDX。 使用LibGDX簽名的Android Studio APK似乎依賴於此庫,無法使用默認設置解析它。 經過一番努力之后,似乎有所幫助的是文件 - 設置 - 構建,執行,部署 - Gradle - Android Studio - 啟用嵌入式Maven存儲庫。

在此輸入圖像描述

順便說一句,創建新的“捆綁”而不是APK開箱即用,沒有任何問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM