Android compile, run the compiler errors Summary of issues

一.   > Could not find com.android.support:support-annotations:28.0.0.
         Required by:
             project :app > com.android.support:support-v4:21.0.3
      > Could not find com.android.support:support-annotations:28.0.0.
         Required by:
             project :app > ch.acra:acra-http:5.3.0 > ch.acra:acra-core:5.3.0 > ch.acra:acra-javacore:5.3.0

 

       Solution:

          1. See abnormality is not found annotations annotation packet, check whether the first dependent Support annotations- , if relied appcompat  packages may be, its internal packet contains annotations;

          2. dependent inoperative, see sdk version corresponds to the version using annotations package version, for example: sdk version is 26, and the support-v4 version 21, the following code will be dependent on the phrase red;

          3. In fact, the above would be useless, Could not find google because com.android.support in the maven repository, you need to add google node in repositories in build.gradle under the project root directory ();

          4. After the addition of the third point may not be used because of maven google library needs gradle on plug-in version 3.2.0, below:

So build.gradle under the root directory but also to improve gradle plug-in version, the corresponding need to be adjusted gradle version gradle-wrapper.properties files under gradle / wrapper directory;

二.   > Annotation processors must be explicitly declared now.  The following dependencies on the compile classpath are found to contain annotation processor.  Please add them to the annotationProcessor configuration.
           - butterknife-6.0.0.jar (butterknife-6.0.0.jar)
  Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior.  Note that this option is deprecated and will be removed in the future.

 

      Solution:

          1. The first solution as the first English tips

                 Add rely   annotationProcessor "com.jakewharton: butterknife: 8.8.1"

          2. The second solution as the second English prompt

                 defaultConfig add the next node    javaCompileOptions includeCompileClasspath = {{annotationProcessorOptions to true}}  , preferably with the first, suggesting the English would say this waste, but you look at specific environmental projects, I use the first or editing is not passed.

 

三.   > com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\XQSKKFJ\.gradle\caches\transforms-1\files-1.1\acra-core-5.3.0.aar\339764307da79406ab48d82ea26a52b1\jars\classes.jar

 

      Solution:

          1. The most simple, in build.gradle setting java jdk version 1.8

 

四.   Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

> Com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: the app / build / intermediates / transforms / dexBuilder / debug / directory numerous n.jar given (n is an integer)

  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: org.acra.sender.HttpSender$Method

 

      Solution:

          1. delete the build directory of the app, the compiler generates is not re-used. It is important to look at the bottom of the phrase error message will be prompted for the location of the conflict. For example, the above error is org.acra.sender.HttpSender this class there are two, one in the local fight aar, the library relies on a network, the network I need is to use the library, you get rid of aar. (According to their specific usage)

 

Guess you like

Origin blog.csdn.net/u012551120/article/details/93459913