찾다

 >  Q&A  >  본문

android-studio - android studio 能通过Clean和Rebuild,但在联手机测试时和Build apk时报错

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2511Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72511Library UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2511Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2511Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2511Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2511Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2511Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42511Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2511Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithJarMergingForDebug UP-TO-DATE
:app:collectDebugMultiDexComponents UP-TO-DATE
:app:transformClassesWithMultidexlistForDebug
ProGuard, version 5.2.1
Reading program jar [C:UsersAdministratorAndroidStudioProjectsTestappbuildintermediatestransformsjarMergingdebugjars11fcombined.jar]
Reading library jar [D:AndroidStudiosdkbuild-tools25.0.2libshrinkedAndroid.jar]
Note: android.support.v4.view.ViewPager calls 'Class.getAnnotation'
Note: android.support.v4.app.NotificationCompatJellybean calls 'Field.getType'
Note: android.support.v4.app.NotificationCompatJellybean: can't find dynamically referenced class android.app.Notification$Action
Note: android.support.v4.media.ParceledListSliceAdapterApi21: can't find dynamically referenced class android.content.pm.ParceledListSlice
Note: android.support.v4.text.ICUCompatApi23: 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.multidex.MultiDexExtractor accesses a method 'apply()' dynamically
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'icon' dynamically

  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 'com.example.administrator.test.R$attr { int icon; }'
  Maybe this is program field 'com.example.administrator.test.R$id { int icon; }'

Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'title' dynamically

  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 'com.example.administrator.test.R$attr { int title; }'
  Maybe this is program field 'com.example.administrator.test.R$id { int 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; }'

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.media.session.MediaSessionCompatApi24 accesses a method 'getCallingPackage()' dynamically

  Maybe this is program method 'android.support.v4.app.ShareCompat$IntentReader { java.lang.String getCallingPackage(); }'
  Maybe this is program method 'android.support.v4.media.session.MediaSessionCompat { java.lang.String getCallingPackage(); }'
  Maybe this is program method 'android.support.v4.media.session.MediaSessionCompat$MediaSessionImpl { java.lang.String getCallingPackage(); }'
  Maybe this is program method 'android.support.v4.media.session.MediaSessionCompat$MediaSessionImplApi21 { java.lang.String getCallingPackage(); }'
  Maybe this is program method 'android.support.v4.media.session.MediaSessionCompat$MediaSessionImplBase { java.lang.String getCallingPackage(); }'

Note: android.support.v4.text.ICUCompatApi23 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 'getScript(java.lang.String)' dynamically

  Maybe this is program method 'android.support.v4.text.ICUCompatIcs { java.lang.String getScript(java.lang.String); }'

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.DrawableUtils accesses a method 'getOpticalInsets()' dynamically
Note: android.support.v7.widget.ViewUtils accesses a method 'makeOptionalFitsSystemWindows()' dynamically
Note: there were 1 classes trying to access annotations using reflection.

  You should consider keeping the annotation attributes
  (using '-keepattributes *Annotation*').
  (http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)

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 6 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 13 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)

Note: you're ignoring all warnings!
Preparing output jar [C:UsersAdministratorAndroidStudioProjectsTestappbuildintermediatesmulti-dexdebugcomponentClasses.jar]
Copying resources from program jar [C:UsersAdministratorAndroidStudioProjectsTestappbuildintermediatestransformsjarMergingdebugjars11fcombined.jar]
:app:transformClassesWithMultidexlistForDebug FAILED
Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:Program FilesJavajdk1.7.0_79binjava.exe'' finished with non-zero exit value 1
Information:BUILD FAILED

Information:Total time: 4.3 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

伊谢尔伦伊谢尔伦2772일 전669

모든 응답(3)나는 대답할 것이다

  • 大家讲道理

    大家讲道理2017-04-18 09:08:24

    SDK가 불완전한 경우 SDK 관리자에 들어가 오른쪽 하단의 패키지 세부정보 표시를 클릭하고 프로젝트에서 생성한 SDK의 다운로드되지 않은 부분을 선택한 후 다운로드를 클릭하세요. 작동하지 않으면 jdk를 1.8 이상으로 변경하세요. jdk1.7에 문제가 있는 경우가 많습니다.

    회신하다
    0
  • PHP中文网

    PHP中文网2017-04-18 09:08:24

    난독화 문제인 것 같습니다
    디버깅 중에 난독화를 끄거나
    난독화 파일이 잘못 작성된 위치를 확인하세요

    회신하다
    0
  • ringa_lee

    ringa_lee2017-04-18 09:08:24

    값 1은 일반적으로 XML 어딘가에 잘못 기록되어 찾기가 쉽지 않습니다

    회신하다
    0
  • 취소회신하다