【问题标题】:Getting error while a signed apk签名 apk 时出错
【发布时间】:2018-04-24 06:47:18
【问题描述】:

分级

  apply plugin: 'com.android.application'

    android {
        compileSdkVersion 26
        buildToolsVersion "26.0.3"
        defaultConfig {
            applicationId "se.btcx.wallet"
            minSdkVersion 21
            targetSdkVersion 26
            versionCode 327
            versionName "4.59.1-btcx"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            multiDexEnabled true
        }

        dexOptions {
            jumboMode true
            javaMaxHeapSize "4g"
        }

        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
            release {
            }
            innerTest {
                matchingFallbacks = ['debug', 'release']
            }
        }

        useLibrary 'org.apache.http.legacy'// for multipart API

        aaptOptions.cruncherEnabled = false
        aaptOptions.useNewCruncher = false

    //    compileOptions {
    //        sourceCompatibility JavaVersion.VERSION_1_8
    //        targetCompatibility JavaVersion.VERSION_1_8
    //    }
        configurations.all {
            resolutionStrategy.force 'junit:junit:4.11'
        }
    }

    buildscript {
        repositories {
            maven { url "http://dl.bintray.com/populov/maven" }
            mavenCentral()
        }
    }
    allprojects {
        repositories {
            maven { url "http://dl.bintray.com/populov/maven" }
            maven { url 'https://jitpack.io' }
            mavenCentral()
        }
    }

    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:appcompat-v7:26.1.0'
        // implementation 'com.android.support.constraint:constraint-layout_navigationdrawer:1.0.2'
        implementation 'com.android.support.constraint:constraint-layout:1.1.0'
        compile 'com.android.support:design:26.0.+'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
        /* compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
                            compile('org.apache.httpcomponents:httpmime:4.3') {
                                exclude module: "httpclient"
                            }*/
        /*compile files('libs/okhttp-2.1.0.jar')
                                compile files('libs/okhttp-urlconnection-2.1.0.jar')
                                compile files('libs/okio-1.1.0.jar')*/
        implementation 'com.android.support:multidex:1.0.3'
        compile 'com.github.bumptech.glide:glide:3.7.0'
        compile 'com.android.support:recyclerview-v7:26.1.0'
        compile 'com.android.support:design:26.1.0'
        compile 'com.intuit.sdp:sdp-android:1.0.5'
        compile 'com.android.volley:volley:1.0.0'
        compile 'me.relex:circleindicator:1.2.2@aar'
        compile 'com.google.zxing:core:3.3.2'
        compile 'com.journeyapps:zxing-android-embedded:3.6.0'
        // compile 'org.greenrobot:eventbus:3.1.1'
        //    compile 'org.bitcoinj:bitcoinj-core:0.14.4'
        //noinspection UseOfBundledGooglePlayServices
        compile 'com.google.android.gms:play-services:12.0.1'
        compile 'com.google.protobuf:protobuf-java:3.1.0'
        compile 'com.google.guava:guava:20.0'
        compile('com.github.tony19:logback-android-classic:1.1.1-6') {
            exclude(group: 'com.google.android', module: 'android')
        }
        compile 'com.github.tony19:logback-android-core:1.1.1-6'
        compile 'com.google.code.findbugs:jsr305:3.0.0'
        compile 'com.squareup.okhttp:okhttp:2.7.5'
        compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
        compile 'org.slf4j:slf4j-api:1.7.25'
        //Logging
        // compile 'org.slf4j:slf4j-api:1.7.12'
        // compile 'org.slf4j:slf4j-simple:1.7.12'
        compile 'org.testng:testng:6.9.6'
        compile 'com.madgag.spongycastle:core:1.58.0.0'
        compile 'com.madgag.spongycastle:prov:1.58.0.0'
        compile 'com.madgag.spongycastle:pkix:1.54.0.0'
        compile 'com.madgag.spongycastle:pg:1.54.0.0'
        compile 'net.jcip:jcip-annotations:1.0'
        implementation files('libs/leveldbjni-all-1.8.jar')
        compile 'org.bitcoinj:orchid:1.2.1'
        compile 'net.java.openjfx.backport:openjfx-78-backport-compat:1.8.0.1'
    }

在生成签名apk的时候,出现如下错误

错误:处理“java/beans/PropertyVetoException.class”时出现问题:

错误:对核心类(java.* 或 javax.*)

错误:未构建核心库时。

错误:这通常是由于无意中包含了核心库文件

错误:在您的应用程序的项目中,使用 IDE 时(例如

错误:Eclipse)。如果你确定你不是故意定义一个

Error:core class,那么这是最可能的解释

错误:继续。

错误:但是,您实际上可能正在尝试在 核心

错误:命名空间,例如你可能取的来源,

错误:来自非 Android 虚拟机项目。这将最

错误:肯定不行。至少,它会危害到

错误:您的应用与平台未来版本的兼容性。

错误:它的合法性也经常受到质疑。

错误:如果你真的打算构建一个核心库——这只是

错误:适合作为创建完整虚拟机的一部分

错误:分发,而不是编译应用程序——然后使用

错误:“--core-library”选项可抑制此错误消息。

错误:如果你继续使用“--core-library”但实际上是

错误:构建应用程序,然后预先警告您的 应用

错误:在某些时候仍然无法构建或运行。请是

错误:为愤怒的客户做好准备,例如,他们发现您的

错误:应用程序在升级操作后停止运行

错误:系统。你会为这个问题负责。

错误:如果您合法地使用了一些恰好位于 a 中的代码

错误:核心包,那么您拥有的最简单安全的替代方法是

错误:重新打包该代码。也就是把有问题的类移到

错误:你自己的包命名空间。这意味着他们永远不会 在

错误:与核心系统类冲突。 JarJar 是一个工具,可以 帮助

错误:你在这个努力。如果你发现你不能这样做,那么

错误:这表明你正在走的路最终会发生

错误:导致痛苦、痛苦、悲伤和悲叹。

错误:1 个错误;中止

错误:任务执行失败 ':app:transformClassesWithPreDexForRelease'.

com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: Unable to pre-dex 'C:\Users\shaileshp.gradle\caches\modules-2\files- 2.1\net.java.openjfx.backport\openjfx-78-backport-compat\1.8.0.1\7cb8f4c47f25736b099d0db2a0c518e909ed6e4d\openjfx-78-backport-compat-1.8.0.1.jar' 到 'D:\AndroidStudioProjects\BTCX_V9\app\build \intermediates\transforms\preDex\release\27'

【问题讨论】:

  • 您是否尝试过重建/清理项目?
  • 似乎您正在尝试使用不属于 Android SDK 而是 Java 的 API。你能重新检查一下吗?

标签: android signed-apk


【解决方案1】:

这是我们在生成签名 apk 时遇到的众所周知问题

查看以下博客,您可能会摆脱问题

http://jmlinnik.blogspot.in/2015/07/android-studio-android-ill-advised-or.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多