1

我想在我的项目的 android studio 中生成签名的 apk,但它给了我错误。我是 android 新手,请帮助我。无法确定问题出在 progaurd 还是 build.gradle 上。在以下部分添加了我的日志,请检查:

Gradle 控制台提供如下堆栈跟踪:

Executing tasks: [:app:assembleRelease]


Configuration on demand is an incubating feature.
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
:app:preBuild UP-TO-DATE
:app:extractProguardFiles UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:compileReleaseAidl UP-TO-DATE
:app:compileReleaseRenderscript UP-TO-DATE
:app:checkReleaseManifest UP-TO-DATE
:app:generateReleaseBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources UP-TO-DATE
:app:createReleaseCompatibleScreenManifests UP-TO-DATE
:app:processReleaseManifest UP-TO-DATE
:app:splitsDiscoveryTaskRelease UP-TO-DATE
:app:processReleaseResources UP-TO-DATE
:app:generateReleaseSources UP-TO-DATE
:app:javaPreCompileRelease UP-TO-DATE
:app:compileReleaseJavaWithJavac UP-TO-DATE
:app:compileReleaseNdk NO-SOURCE
:app:compileReleaseSources UP-TO-DATE
:app:lintVitalRelease
:app:mergeReleaseShaders UP-TO-DATE
:app:compileReleaseShaders UP-TO-DATE
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets UP-TO-DATE
:app:processReleaseJavaRes NO-SOURCE
:app:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:app:transformClassesAndResourcesWithProguardForRelease
ProGuard, version 5.3.3
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\design-26.0.0-alpha1.aar\abc0b6e3eb8368bdf2a74658166bb154\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.0.0-alpha1.aar\8974eefbe53db7b2eeb5573e0af4a774\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\constraint-layout-1.0.2.aar\31ac9e7d606122db6b0e603e8c5f6fd5\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\animated-vector-drawable-26.0.0-alpha1.aar\3f5410882f8bf1539817c40d4a0986ca\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\support-vector-drawable-26.0.0-alpha1.aar\04e551f6ff90084336c8ae72092ea520\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\recyclerview-v7-26.0.0-alpha1.aar\6d50886c4539221b2c415b5e96b0bcbf\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\transition-26.0.0-alpha1.aar\55c4deeec5aa27b9de2fda37ed841bfc\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\support-v4-26.0.0-alpha1.aar\924d0853d9d9014632b2c3d87c300708\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\support-media-compat-26.0.0-alpha1.aar\764ef8dd6589dc8ae4a497744db30039\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\support-fragment-26.0.0-alpha1.aar\2692841d224fdbd683c57a4735fde6be\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\support-core-utils-26.0.0-alpha1.aar\6146ab7da60dccd21905bfb04e494aba\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\support-core-ui-26.0.0-alpha1.aar\34a03cd0a19adf721c7063e1df11e380\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\.gradle\caches\transforms-1\files-1.1\support-compat-26.0.0-alpha1.aar\0e033036815fd7a9d996774eba6bed0f\jars\classes.jar] (filtered)
Reading program jar [C:\Users\R415109\AppData\Local\Android\Sdk\extras\android\m2repository\com\android\support\support-annotations\26.0.0-alpha1\support-annotations-26.0.0-alpha1.jar] (filtered)
Reading program jar [C:\Users\R415109\AppData\Local\Android\Sdk\extras\m2repository\com\android\support\constraint\constraint-layout-solver\1.0.2\constraint-layout-solver-1.0.2.jar] (filtered)
Reading program directory [D:\VCDM\BT_REMCO_APP_DEV\Working\06_Code\Hyundai Sync Working Project\app\build\intermediates\classes\release] (filtered)
Reading program jar [D:\VCDM\BT_REMCO_APP_DEV\Working\06_Code\Hyundai Sync Working Project\app\build\intermediates\transforms\mergeJavaRes\release\0.jar] (filtered)
Reading library jar [C:\Users\R415109\AppData\Local\Android\Sdk\platforms\android-26\android.jar]
Reading library jar [C:\Users\R415109\AppData\Local\Android\Sdk\platforms\android-26\optional\org.apache.http.legacy.jar]
Note: duplicate definition of library class [org.apache.http.params.HttpConnectionParams]
Note: duplicate definition of library class [org.apache.http.params.HttpParams]
Note: duplicate definition of library class [org.apache.http.params.CoreConnectionPNames]
Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
Note: duplicate definition of library class [org.apache.http.conn.scheme.LayeredSocketFactory]
Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
Note: duplicate definition of library class [android.net.http.SslCertificate]
Note: duplicate definition of library class [android.net.http.HttpResponseCache]
Note: duplicate definition of library class [android.net.http.SslError]

Note: there were 11 duplicate class definitions.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)

Note: android.support.v4.app.NotificationCompatJellybean calls 'Field.getType'

Warning: android.support.v4.app.NotificationCompatApi26: can't find referenced method 'java.lang.String getChannel()' in library class android.app.Notification
Warning: android.support.v4.app.NotificationCompatApi26$Builder: can't find referenced method 'android.app.Notification$Builder setChannel(java.lang.String)' in library class android.app.Notification$Builder
Warning: android.support.v4.media.session.MediaControllerCompatApi26: can't find referenced method 'int getRepeatMode()' in library class android.media.session.MediaController
Warning: android.support.v4.media.session.MediaControllerCompatApi26: can't find referenced method 'boolean isShuffleModeEnabled()' in library class android.media.session.MediaController
Warning: android.support.v4.media.session.MediaControllerCompatApi26$TransportControls: can't find referenced method 'void setRepeatMode(int)' in library class android.media.session.MediaController$TransportControls
Warning: android.support.v4.media.session.MediaControllerCompatApi26$TransportControls: can't find referenced method 'void setShuffleModeEnabled(boolean)' in library class android.media.session.MediaController$TransportControls
Warning: android.support.v4.media.session.MediaSessionCompatApi26: can't find referenced method 'void setRepeatMode(int)' in library class android.media.session.MediaSession
Warning: android.support.v4.media.session.MediaSessionCompatApi26: can't find referenced method 'void setShuffleModeEnabled(boolean)' in library class android.media.session.MediaSession
Warning: android.support.v7.widget.FastScroller: can't find referenced class android.support.v7.widget.FastScroller$State
Warning: android.support.v7.widget.FastScroller: can't find referenced class android.support.v7.widget.FastScroller$DragState
Warning: android.support.v7.widget.FastScroller: can't find referenced class android.support.v7.widget.FastScroller$AnimationState
Warning: android.support.v7.widget.FastScroller: can't find referenced class android.support.v7.widget.FastScroller$State

Note: android.support.v4.media.ParceledListSliceAdapterApi21: can't find dynamically referenced class android.content.pm.ParceledListSlice
Note: android.support.v4.text.ICUCompatApi21: can't find dynamically referenced class libcore.icu.ICU
Note: android.support.v4.text.ICUCompatIcs: can't find dynamically referenced class libcore.icu.ICU
Note: android.support.v7.app.ResourcesFlusher: can't find dynamically referenced class android.content.res.ThemedResourceCache
Note: android.support.v7.widget.DrawableUtils: can't find dynamically referenced class android.graphics.Insets
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'icon' dynamically
      Maybe this is program field 'android.support.design.R$attr { int icon; }'
      Maybe this is program field 'android.support.design.R$id { int icon; }'
      Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { int icon; }'
      Maybe this is program field 'android.support.v7.appcompat.R$attr { int icon; }'
      Maybe this is program field 'android.support.v7.appcompat.R$id { int icon; }'
      Maybe this is program field 'hyundai.iblue.R$attr { int icon; }'
      Maybe this is program field 'hyundai.iblue.R$id { int icon; }'
      Maybe this is library field 'android.R$attr { int icon; }'
      Maybe this is library field 'android.R$id { int icon; }'
      Maybe this is library field 'android.app.LauncherActivity$ListItem { android.graphics.drawable.Drawable icon; }'
      Maybe this is library field 'android.app.Notification { int icon; }'
      Maybe this is library field 'android.app.Notification$Action { int icon; }'
      Maybe this is library field 'android.appwidget.AppWidgetProviderInfo { int icon; }'
      Maybe this is library field 'android.content.pm.PackageItemInfo { int icon; }'
      Maybe this is library field 'android.content.pm.ResolveInfo { int icon; }'
      Maybe this is library field 'android.inputmethodservice.Keyboard$Key { android.graphics.drawable.Drawable icon; }'
      Maybe this is library field 'android.service.notification.Condition { int icon; }'
      Maybe this is library field 'android.speech.tts.TextToSpeech$EngineInfo { int icon; }'
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'title' dynamically
      Maybe this is program field 'android.support.design.R$attr { int title; }'
      Maybe this is program field 'android.support.design.R$id { int title; }'
      Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { java.lang.CharSequence title; }'
      Maybe this is program field 'android.support.v7.appcompat.R$attr { int title; }'
      Maybe this is program field 'android.support.v7.appcompat.R$id { int title; }'
      Maybe this is program field 'hyundai.iblue.R$attr { int title; }'
      Maybe this is program field 'hyundai.iblue.R$id { int title; }'
      Maybe this is library field 'android.R$attr { int title; }'
      Maybe this is library field 'android.R$id { int title; }'
      Maybe this is library field 'android.app.Notification$Action { java.lang.CharSequence title; }'
      Maybe this is library field 'android.preference.PreferenceActivity$Header { java.lang.CharSequence title; }'
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'actionIntent' dynamically
      Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { android.app.PendingIntent actionIntent; }'
      Maybe this is library field 'android.app.Notification$Action { android.app.PendingIntent actionIntent; }'
Note: android.support.v4.app.NotificationManagerCompatKitKat accesses a declared field 'OP_POST_NOTIFICATION' dynamically
      Maybe this is program field 'android.support.v4.app.NotificationManagerCompatKitKat { java.lang.String OP_POST_NOTIFICATION; }'
Note: android.support.v4.text.ICUCompatApi21 accesses a method 'addLikelySubtags(java.util.Locale)' dynamically
      Maybe this is program method 'android.support.v4.text.ICUCompatIcs { java.lang.String addLikelySubtags(java.util.Locale); }'
Note: android.support.v4.text.ICUCompatIcs accesses a method 'addLikelySubtags(java.lang.String)' dynamically
Note: android.support.v7.app.ResourcesFlusher accesses a declared field 'mDrawableCache' dynamically
Note: android.support.v7.app.ResourcesFlusher accesses a declared field 'mUnthemedEntries' dynamically
Note: android.support.v7.widget.ViewUtils accesses a method 'makeOptionalFitsSystemWindows()' dynamically
Note: the configuration keeps the entry point 'android.support.graphics.drawable.VectorDrawableCompat$VPath { void setPathData(android.support.graphics.drawable.PathParser$PathDataNode[]); }', but not the descriptor class 'android.support.graphics.drawable.PathParser$PathDataNode'
Note: there were 1 classes trying to access generic signatures using reflection.
      You should consider keeping the signature attributes
      (using '-keepattributes Signature').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
Note: there were 1 unkept descriptor classes in kept class members.
      You should consider explicitly keeping the mentioned classes
      (using '-keep').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
Note: there were 5 unresolved dynamic references to classes or interfaces.
      You should check if you need to specify additional program jars.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 9 accesses to class members by means of introspection.
      You should consider explicitly keeping the mentioned class members
      (using '-keep' or '-keepclassmembers').
      (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)

Warning: there were 4 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 8 unresolved references to library class members.
         You probably need to update the library versions.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)

Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details

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

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

BUILD FAILED in 38s

21 actionable tasks: 2 executed, 19 up-to-date

请帮助我获得签名的apk。尝试了一周,但无法找到确切的解决方案。

4

0 回答 0