Ключевое слово в защите информации
КЛЮЧЕВОЕ СЛОВО
в защите информации
Получить ГОСТ TLS-сертификат для домена (SSL-сертификат)
Добро пожаловать, Гость! Чтобы использовать все возможности Вход или Регистрация.

Уведомление

Icon
Error

Опции
К последнему сообщению К первому непрочитанному
Offline alextrenkenshu  
#1 Оставлено : 4 декабря 2015 г. 17:05:34(UTC)
alextrenkenshu

Статус: Новичок

Группы: Участники
Зарегистрирован: 04.12.2015(UTC)
Сообщений: 3

Добрый день,
при создании apk приложения с примерами выскакивает ошибка:
trouble processing "javax/xml/crypto/AlgorithmMethod.class":

Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.

This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.

However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.

If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.

If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.

If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.

1 error; aborting


FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_65\bin\java.exe'' finished with non-zero exit value

Какие действия необходимо предпринять, чтобы решить данную проблему?
Offline Евгений Афанасьев  
#2 Оставлено : 4 декабря 2015 г. 17:20:05(UTC)
Евгений Афанасьев

Статус: Сотрудник

Группы: Участники
Зарегистрирован: 06.12.2008(UTC)
Сообщений: 3,919
Российская Федерация
Откуда: Крипто-Про

Сказал(а) «Спасибо»: 20 раз
Поблагодарили: 688 раз в 649 постах
Здравствуйте.
--core-library пробовали указывать?
Offline alextrenkenshu  
#3 Оставлено : 4 декабря 2015 г. 17:52:36(UTC)
alextrenkenshu

Статус: Новичок

Группы: Участники
Зарегистрирован: 04.12.2015(UTC)
Сообщений: 3

я не могу разобраться, как это сделать.
Offline Евгений Афанасьев  
#4 Оставлено : 4 декабря 2015 г. 18:28:11(UTC)
Евгений Афанасьев

Статус: Сотрудник

Группы: Участники
Зарегистрирован: 06.12.2008(UTC)
Сообщений: 3,919
Российская Федерация
Откуда: Крипто-Про

Сказал(а) «Спасибо»: 20 раз
Поблагодарили: 688 раз в 649 постах
Пример конфигурации:

Код:

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

apply plugin: 'com.android.application'

repositories {
    jcenter()
}

android {

    compileSdkVersion 14
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "ru.CryptoPro.ACSPClientApp"
        minSdkVersion 11
        targetSdkVersion 14
        versionCode 1
        versionName "1.0"
    }

    dexOptions {
        preDexLibraries = false
    }

    project.tasks.withType(com.android.build.gradle.tasks.Dex) {
        additionalParameters=['--core-library']
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_6
        targetCompatibility JavaVersion.VERSION_1_6
    }

    packagingOptions {
        exclude 'META-INF/Digest.CP'
        exclude 'META-INF/Sign.CP'
    }

    lintOptions {
        abortOnError false
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    provided fileTree(include: ['*.jar'], dir: '../xml_libs')
    provided 'xalan:xalan:2.7.0'
}


В libs:

ASN1P.jar
asn1rt.jar
bcpkix-jdk15on-1.50.jar
bcprov-jdk15on-1.50.jar
CAdES.jar
cpSSL.jar
JCP.jar
JCPRequest.jar
JCPRevCheck.jar
JCPRevTools.jar
JCPxml.jar
JCSP.jar
JInitCSP.jar
json-20080701.jar
support-v4-r7.jar
xmlsec-1.4.4.jar

В xml_libs:

commons-logging-1.1.1.jar
serializer-2.7.1.jar
xalan-2.7.0.jar
Offline alextrenkenshu  
#5 Оставлено : 14 декабря 2015 г. 14:22:11(UTC)
alextrenkenshu

Статус: Новичок

Группы: Участники
Зарегистрирован: 04.12.2015(UTC)
Сообщений: 3

Добрый день, спасибо за ответ.

Сделал, как советовали, но проект не собирается:
выскакивает ошибка Error:(23, 0) Could not find property 'com' on com.android.build.gradle.AppExtension_Decorated@5261b469,
указывающая на следующую строчку.
project.tasks.withType(com.android.build.gradle.tasks.Dex) {
additionalParameters=['--core-library']
}

Использую Android Studio 1.5.
RSS Лента  Atom Лента
Пользователи, просматривающие эту тему
Быстрый переход  
Вы не можете создавать новые темы в этом форуме.
Вы не можете отвечать в этом форуме.
Вы не можете удалять Ваши сообщения в этом форуме.
Вы не можете редактировать Ваши сообщения в этом форуме.
Вы не можете создавать опросы в этом форуме.
Вы не можете голосовать в этом форуме.