-1

私のアプリケーションをビルドしようとしています。しかし、私は解放のために署名したAPKを作成しようとすると、それは、Android Studioでエラー3.0.1リリース署名付きAPKのエラー:エラー: "javax/xml/namespace/QName.class"の処理中にエラーが発生しました。

Error:trouble processing "javax/xml/namespace/QName.class": 
Error:Ill-advised or mistaken usage of a core class (java.* or javax.*) 
Error:when not building a core library. 
Error:This is often due to inadvertently including a core library file 
Error:in your application's project, when using an IDE (such as 
Error:Eclipse). If you are sure you're not intentionally defining a 
Error:core class, then this is the most likely explanation of what's 
Error:going on. 
Error:However, you might actually be trying to define a class in a core 
Error:namespace, the source of which you may have taken, for example, 
Error:from a non-Android virtual machine project. This will most 
Error:assuredly not work. At a minimum, it jeopardizes the 
Error:compatibility of your app with future versions of the platform. 
Error:It is also often of questionable legality. 
Error:If you really intend to build a core library -- which is only 
Error:appropriate as part of creating a full virtual machine 
Error:distribution, as opposed to compiling an application -- then use 
Error:the "--core-library" option to suppress this error message. 
Error:If you go ahead and use "--core-library" but are in fact 
Error:building an application, then be forewarned that your application 
Error:will still fail to build or run, at some point. Please be 
Error:prepared for angry customers who find, for example, that your 
Error:application ceases to function once they upgrade their operating 
Error:system. You will be to blame for this problem. 
Error:If you are legitimately using some code that happens to be in a 
Error:core package, then the easiest safe alternative you have is to 
Error:repackage that code. That is, move the classes in question into 
Error:your own package namespace. This means that they will never be in 
Error:conflict with core system classes. JarJar is a tool that may help 
Error:you in this endeavor. If you find that you cannot do this, then 
Error:that is an indication that the path you are on will ultimately 
Error:lead to pain, suffering, grief, and lamentation. 
Error:1 error; aborting 
Error:Execution failed for task ':app:transformClassesWithDexForRelease'. 
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list D:\Android\Projects\Online Food Order\CommonApp\app\build\intermediates\multi-dex\release\maindexlist.txt --output D:\Android\Projects\Online Food Order\CommonApp\app\build\intermediates\transforms\dex\release\0 --min-sdk-version 17 D:\Android\Projects\Online Food Order\CommonApp\app\build\intermediates\transforms\jarMerging\release\0.jar} 
Information:BUILD FAILED in 1m 28s 
Information:34 errors 
Information:0 warnings 

次は私を与える私はすべてを見つけることを試みたが、この問題を解決するための解決策を得ることができません。誰でも私を助けてくださいそれを克服してください。

以下は私のGradleファイルです。

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 


repositories { 
    maven { url 'https://maven.fabric.io/public' } 
    maven { url 'https://maven.google.com' } 
} 

android { 

    compileSdkVersion 27 
    buildToolsVersion "26.0.2" 
    useLibrary 'org.apache.http.legacy' 

    defaultConfig { 
     applicationId "<My Project Id>" 
     minSdkVersion 17 
     targetSdkVersion 27 
     versionCode 1 
     versionName "1.0.0" 
     multiDexEnabled true 
     manifestPlaceholders = [onesignal_app_id: "<My Onesignal App Id", 
           // Project number pulled from dashboard, local value is ignored. 
           onesignal_google_project_number: "REMOTE"] 

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

    dexOptions { 
     javaMaxHeapSize "4g" 
    } 

    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES' 
    } 

    lintOptions { 
     checkReleaseBuilds false 
     abortOnError false 
    } 

} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:27.0.2' 
    compile 'com.android.support:multidex:1.0.1' 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    compile 'com.google.android.gms:play-services:11.6.2' 
    compile('com.twitter.sdk.android:twitter:[email protected]') { 
     transitive = true; 
     exclude module: 'gson'; 
    } 
    compile 'com.android.support:design:27.0.2' 
    compile 'com.android.support:support-v13:+' 
    compile 'com.paypal.sdk:paypal-android-sdk:2.13.1' 
    compile 'com.android.support:support-v4:27.0.2' 
    compile 'com.baoyz.swipemenulistview:library:1.3.0' 
    compile 'com.braintreepayments.api:drop-in:3.+' 
    compile 'com.lukekorth:mailable_log:0.1.4' 
    compile 'com.squareup.retrofit2:retrofit:2.1.0' 
    compile 'com.google.code.gson:gson:2.6.2' 
    compile 'com.squareup.retrofit2:converter-gson:2.1.0' 
    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1' 
    compile 'com.squareup.okhttp3:okhttp:3.4.1' 
    compile 'com.google.firebase:firebase-core:11.6.2' 
    compile 'com.google.firebase:firebase-messaging:11.6.2' 
    compile 'com.facebook.android:facebook-login:4.27.0' 
    compile 'com.onesignal:OneSignal:[3.6.2, 3.99.99]' 
    compile 'net.authorize:accept-sdk-android:1.0.2' 
    compile 'com.jakewharton:butterknife:8.5.1' 
} 

configurations.all { 
    resolutionStrategy.eachDependency { DependencyResolveDetails details -> 
     def requested = details.requested 
     if (requested.group == 'com.android.support') { 
      if (!requested.name.startsWith("multidex")) { 
       details.useVersion '26.0.2' 
      } 
     } 
    } 
} 

apply plugin: 'com.google.gms.google-services' 

私もthisを見てきましたが、これは私が解決策を解決するために助けることができませんでした。

ご協力いただければ幸いです。前もって感謝します。

+0

誤って 'javax'パッケージからクラスをインポートしたと思います。 'javax'からのインポートをチェックし、それらが正しいパッケージであるか、正しくインポートされているかどうかを検証します。 – Merka

+0

@Merkaどのようにしてjavaxからのインポートをチェックできますか?あなたはもっとやり方を説明してください、そうすることができますか? –

+0

@PravinsinghWaghela私はあなたのプロジェクト全体で 'import javax'を' Ctrl + shift + F'で検索しました。 @Hangmanのリンクも原因かもしれません。 – Merka

答えて

1

私は同じ問題に直面しています。数時間のグーグル・プレイの後、私はthisへのAmira Elsayed Ismailのコメントによる回避策を見つけました。

はソリューション

:私は私のプロジェクトレベルbuild.gradleファイルに以前のバージョンへのGradleを戻ってきた

今すぐ

classpath 'com.android.tools.build:gradle:2.3.3' 

classpath 'com.android.tools.build:gradle:3.0.0' 

を変更し、それが正常に動作します。

+0

それはまた私のためのトリックでしたが、私は本当に理由を知りたいです。 –

関連する問題