Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android support libs not found when predexing #712

Closed
hjohn opened this issue Jan 29, 2016 · 6 comments
Closed

Android support libs not found when predexing #712

hjohn opened this issue Jan 29, 2016 · 6 comments

Comments

@hjohn
Copy link

hjohn commented Jan 29, 2016

I have the problem that when I use the predex option to shave off some build time, the deployed application will not function correctly because of missing classes that are provided by the android support libraries:

 java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/ContextCompat

When I disable the predexing, the application functions as expected.

I've noticed two things:

  1. The predexedLibs folder does not contain predexed versions of the android support libs (but it does contain one for the other aar and all the jars that I include in my project)... seems odd to me.

  2. The plugin gives me a warning right at the start regarding the android support libs, but I'm unsure what to do about it, or what it means (and why it would be different with predex on/off -- the warnings is there in both cases):

[WARNING] The following dependencies may conflict with the internal versions provided by the Android platform:
[org.khronos:opengl-api:jar:gl1.1-android-2.1_r1:provided, org.json:json:jar:20080701:provided, commons-logging:commons-logging:jar:1.1.1:provided, xerces:xmlParserAPIs:jar:2.6.2:provided, xpp3:xpp3:jar:1.1.4c:provided, org.apache.httpcomponents:httpclient:jar:4.0.1:provided]
It is recommended to shade these artifacts. You can read more about this here: http://simpligility.github.io/android-maven-plugin/shaded-commons-codec.html.
Alternatively, you can disable this warning with the'disableConflictingDependenciesWarning' parameter.
[WARNING] Adding jar from libs folder to classpath: C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v4_23.1.1\libs\internal_impl-23.1.1.jar
[WARNING] Adding jar from libs folder to classpath: C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v13_23.1.1\libs\internal_impl-23.1.1.jar
[WARNING] Transitive dependencies should really be provided by Maven dependency management.
      We suggest you to ask the above providers to package their component properly.
      Things may break at compile and/or runtime due to multiple copies of incompatible libraries.

This is my pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>hs.wod</groupId>
  <artifactId>wod4</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>apk</packaging>
  <name>Wod4</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <platform.version>4.1.1.4</platform.version>
    <android.plugin.version>4.3.0</android.plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.android</groupId>
      <artifactId>android</artifactId>
      <version>${platform.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.android.support</groupId>
      <artifactId>support-v13</artifactId>
      <version>23.1.1</version>
      <type>aar</type>
    </dependency>

    <dependency>
      <groupId>com.squareup.dagger</groupId>
      <artifactId>dagger</artifactId>
      <version>1.2.2</version>
    </dependency>
    <dependency>
      <groupId>com.squareup.dagger</groupId>  <!-- pulls in guava, does not need to be part of apk, but probably is -->
      <artifactId>dagger-compiler</artifactId>
      <version>1.2.2</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>3.0.1</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.7.0</version>
    </dependency>
    <dependency>
      <groupId>com.jakewharton.threetenabp</groupId>
      <artifactId>threetenabp</artifactId>
      <version>1.0.3</version>
      <type>aar</type>
    </dependency>
    <dependency>
      <groupId>com.squareup.retrofit2</groupId>
      <artifactId>retrofit</artifactId>
      <version>2.0.0-beta3</version>
    </dependency>
    <dependency>
      <groupId>com.squareup.retrofit2</groupId>
      <artifactId>converter-jackson</artifactId>
      <version>2.0.0-beta3</version>
    </dependency>
  </dependencies>
  <build>
    <finalName>${project.artifactId}</finalName>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.simpligility.maven.plugins</groupId>
          <artifactId>android-maven-plugin</artifactId>
          <version>${android.plugin.version}</version>
          <extensions>true</extensions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.simpligility.maven.plugins</groupId>
        <artifactId>android-maven-plugin</artifactId>
        <configuration>
          <dexOptimize>false</dexOptimize>
          <dex>
            <preDex>true</preDex>
            <preDexLibLocation>c:/dev/tmp/predexedLibs</preDexLibLocation>
          </dex>
          <sdk>
            <platform>23</platform>
            <path>C:\Program Files (x86)\Android\android-sdk</path>
          </sdk>
          <includeLibsJarsFromAar>true</includeLibsJarsFromAar>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <repositories>
      <repository>
          <id>android-support</id>
          <url>file:///C:/Program Files (x86)/Android/android-sdk/extras/android/m2repository</url>
      </repository>
  </repositories>
</project>

And here's the maven output:

$ mvn clean install -DskipTests=true
[INFO] Scanning for projects...
[WARNING] The following dependencies may conflict with the internal versions provided by the Android platform:
[org.khronos:opengl-api:jar:gl1.1-android-2.1_r1:provided, org.json:json:jar:20080701:provided, commons-logging:commons-logging:jar:1.1.1:provided, xerces:xmlParserAPIs:jar:2.6.2:provided, xpp3:xpp3:jar:1.1.4c:provided, org.apache.httpcomponents:httpclient:jar:4.0.1:provided]
It is recommended to shade these artifacts. You can read more about this here: http://simpligility.github.io/android-maven-plugin/shaded-commons-codec.html.
Alternatively, you can disable this warning with the'disableConflictingDependenciesWarning' parameter.
[WARNING] Adding jar from libs folder to classpath: C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v4_23.1.1\libs\internal_impl-23.1.1.jar
[WARNING] Adding jar from libs folder to classpath: C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v13_23.1.1\libs\internal_impl-23.1.1.jar
[WARNING] Transitive dependencies should really be provided by Maven dependency management.
          We suggest you to ask the above providers to package their component properly.
          Things may break at compile and/or runtime due to multiple copies of incompatible libraries.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Wod4 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wod4 ---
[INFO] Deleting C:\Dev\Workspaces\workspace-java8\wod-android\target
[INFO]
[INFO] --- android-maven-plugin:4.3.0:generate-sources (default-generate-sources) @ wod4 ---
[INFO] Manifest copied from C:\Dev\Workspaces\workspace-java8\wod-android\src\main\AndroidManifest.xml to C:\Dev\Workspaces\workspace-java8\wod-android\target\AndroidManifest.xml
[INFO] Extracting libs
[INFO] Extracting aar support-v13...
[INFO] Extracting aar support-v4...
[INFO] Extracting aar threetenabp...
[INFO] Generating R file for hs.wod:wod4:apk:1.0.0-SNAPSHOT
[INFO] Adding R gen folder to compile classpath: C:\Dev\Workspaces\workspace-java8\wod-android\target\generated-sources\r
[INFO] Skip BuildConfig.java generation for com.android.support support-v13
[INFO] Skip BuildConfig.java generation for com.android.support support-v4
[INFO] Skip BuildConfig.java generation for com.jakewharton.threetenabp threetenabp
[INFO] Adding AIDL gen folder to compile classpath: C:\Dev\Workspaces\workspace-java8\wod-android\target\generated-sources\aidl
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ wod4 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Dev\Workspaces\workspace-java8\wod-android\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5:compile (default-compile) @ wod4 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 72 source files to C:\Dev\Workspaces\workspace-java8\wod-android\target\classes
[INFO] /C:/Dev/Workspaces/workspace-java8/wod-android/src/main/java/com/example/wod3/controls/DynamicListView.java: C:\Dev\Workspaces\workspace-java8\wod-android\src\main\java\com\example\wod3\controls\DynamicListView.java uses unchecked or unsafe operations.
[INFO] /C:/Dev/Workspaces/workspace-java8/wod-android/src/main/java/com/example/wod3/controls/DynamicListView.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- android-maven-plugin:4.3.0:emma (default-emma) @ wod4 ---
[INFO]
[INFO] --- android-maven-plugin:4.3.0:proguard (default-proguard) @ wod4 ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ wod4 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Dev\Workspaces\workspace-java8\wod-android\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5:testCompile (default-testCompile) @ wod4 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ wod4 ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- android-maven-plugin:4.3.0:dex (default-dex) @ wod4 ---
[INFO] Pre dex-ing libraries for faster dex-ing of the final application.
[INFO] Convert classes to Dex : C:\Dev\Workspaces\workspace-java8\wod-android\target\classes.dex
[INFO]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ wod4 ---
[INFO] Building jar: C:\Dev\Workspaces\workspace-java8\wod-android\target\wod4.jar
[INFO]
[INFO] --- android-maven-plugin:4.3.0:apk (default-apk) @ wod4 ---
[INFO] Generating debug apk.
[INFO] Adding native libraries : []
[INFO]
[INFO] --- android-maven-plugin:4.3.0:internal-pre-integration-test (default-internal-pre-integration-test) @ wod4 ---
[INFO] maven.skip.tests set - skipping tests
[INFO]
[INFO] --- android-maven-plugin:4.3.0:internal-integration-test (default-internal-integration-test) @ wod4 ---
[INFO] maven.skip.tests set - skipping tests
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ wod4 ---
[INFO] Installing C:\Dev\Workspaces\workspace-java8\wod-android\target\wod4.apk to C:\Users\John\.m2\repository\hs\wod\wod4\1.0.0-SNAPSHOT\wod4-1.0.0-SNAPSHOT.apk
[INFO] Installing C:\Dev\Workspaces\workspace-java8\wod-android\pom.xml to C:\Users\John\.m2\repository\hs\wod\wod4\1.0.0-SNAPSHOT\wod4-1.0.0-SNAPSHOT.pom
[INFO] Installing C:\Dev\Workspaces\workspace-java8\wod-android\target\wod4.jar to C:\Users\John\.m2\repository\hs\wod\wod4\1.0.0-SNAPSHOT\wod4-1.0.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.399 s
[INFO] Finished at: 2016-01-29T12:06:04+01:00
[INFO] Final Memory: 28M/367M
[INFO] ------------------------------------------------------------------------
@hjohn
Copy link
Author

hjohn commented Jan 29, 2016

I noticed a size difference in the APK file as well.

With predex set to false:

-rw-r--r-- 1 John 197121  179942 Jan 29 12:12 wod4.ap_
-rw-r--r-- 1 John 197121 2633080 Jan 29 12:12 wod4.apk
-rw-r--r-- 1 John 197121  218992 Jan 29 12:12 wod4.jar

With predex set to true:

-rw-r--r-- 1 John 197121  179942 Jan 29 12:13 wod4.ap_
-rw-r--r-- 1 John 197121 2001080 Jan 29 12:13 wod4.apk
-rw-r--r-- 1 John 197121  218995 Jan 29 12:13 wod4.jar

@mosabua
Copy link
Member

mosabua commented Jan 29, 2016

It might have to do with you using a file repository. Could you try with that removed? You can get the artifacts into your main repository with the Maven Android SDK Deployer.. https://github.com/simpligility/maven-android-sdk-deployer

@hjohn
Copy link
Author

hjohn commented Jan 29, 2016

I removed the local repository and installed the support-v13 and android sdk 23 into the main repo. Although the dexing step adds additional jars now in the predexedlibs folder, it still does not work. The file sizes I posted above are still the same and the one that is predexed is crashing because of missing support classes still.

The additional jars it added to the predexedlibs folders were:

internal_impl-23.1.1.jar
support-annotations-23.1.1.jar

Still missing over 600 kb of classes it seems in the APK.

@hjohn
Copy link
Author

hjohn commented Jan 29, 2016

Here is a diff between predex false / true when run with:

  mvn clean install |grep -i dex:

Output:

    --- $ mvn -e -X clean install -DskipTests=true -U |gre 
    +++ $ mvn -e -X clean install -DskipTests=true -U |gre 
    @@ -1,7 +1,7 @@
     $ mvn -e -X clean install -DskipTests=true -U |grep -i dex
     [DEBUG] Goal:          com.simpligility.maven.plugins:android-maven-plugin:4.3.0:dex (default-dex)
       <dex>
    -    <preDex>false</preDex>
    +    <preDex>true</preDex>
         <preDexLibLocation>c:/dev/tmp/predexedLibs</preDexLibLocation>
       </dex>
       <dexArguments>${android.dex.dexarguments}</dexArguments>
    @@ -22,7 +22,7 @@
     [INFO] --- android-maven-plugin:4.3.0:dex (default-dex) @ wod4 ---
     [DEBUG] Configuring mojo com.simpligility.maven.plugins:android-maven-plugin:4.3.0:dex from plugin realm ClassRealm[extension>com.simpligility.maven.plugins:android-maven-plugin:4.3.0, parent: sun.misc.Launcher$AppClassLoader@70dea4e]
     [DEBUG] Configuring mojo 'com.simpligility.maven.plugins:android-maven-plugin:4.3.0:dex' with basic configurator -->
    -[DEBUG]   (f) preDex = false
    +[DEBUG]   (f) preDex = true
     [DEBUG]   (f) preDexLibLocation = c:/dev/tmp/predexedLibs
     [DEBUG]   (f) dex = com.simpligility.maven.plugins.android.configuration.Dex@158119bf
     [DEBUG]   (f) dexCoreLibrary = false
    @@ -56,8 +56,25 @@
     [DEBUG] Adding dex input : C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v13_23.1.0\classes.jar
     [DEBUG] Adding dex input : C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v13_23.1.0\libs\internal_impl-23.1.0.jar
     [DEBUG] Adding dex input : C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cjt_threetenabp_1.0.3\classes.jar
    -[DEBUG] C:\Program Files\Java\jdk1.8.0_66\jre\bin\java [-Xmx1024M, -jar, C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.2\lib\dx.jar, --dex, --no-optimize, --output=C:\Dev\Workspaces\workspace-java8\wod-android\target\classes.dex, C:\Users\John\.m2\repository\com\squareup\javawriter\2.5.0\javawriter-2.5.0.jar, C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cjt_threetenabp_1.0.3\classes.jar, C:\Users\John\.m2\repository\com\google\guava\guava\15.0\guava-15.0.jar, C:\Users\John\.m2\repository\com\squareup\dagger\dagger\1.2.2\dagger-1.2.2.jar, C:\Users\John\.m2\repository\com\squareup\okio\okio\1.6.0\okio-1.6.0.jar, C:\Users\John\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.7.0\jackson-core-2.7.0.jar, C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v13_23.1.0\classes.jar, C:\Users\John\.m2\repository\com\squareup\dagger\dagger-compiler\1.2.2\dagger-compiler-1.2.2.jar, C:\Users\John\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.7.0\jackson-databind-2.7.0.jar, C:\Users\John\.m2\repository\org\threeten\threetenbp\1.3.1\threetenbp-1.3.1-no-tzdb.jar, C:\Users\John\.m2\repository\com\squareup\retrofit2\retrofit\2.0.0-beta3\retrofit-2.0.0-beta3.jar, C:\Users\John\.m2\repository\com\android\support\support-annotations\23.1.0\support-annotations-23.1.0.jar, C:\Dev\Workspaces\workspace-java8\wod-android\target\classes, C:\Users\John\.m2\repository\com\squareup\okhttp3\okhttp\3.0.1\okhttp-3.0.1.jar, C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v4_23.1.0\libs\internal_impl-23.1.0.jar, C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v13_23.1.0\libs\internal_impl-23.1.0.jar, C:\Users\John\.m2\repository\com\squareup\retrofit2\converter-jackson\2.0.0-beta3\converter-jackson-2.0.0-beta3.jar, C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v4_23.1.0\classes.jar, C:\Users\John\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.7.0\jackson-annotations-2.7.0.jar, C:\Users\John\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar]
    +[INFO] Pre dex-ing libraries for faster dex-ing of the final application.
    +[DEBUG] C:\Program Files\Java\jdk1.8.0_66\jre\bin\java [-Xmx1024M, -jar, C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.2\lib\dx.jar, --dex, --no-optimize, --output=C:\Dev\Workspaces\workspace-java8\wod-android\target\classes.dex, c:\dev\tmp\predexedLibs\okhttp-3.0.1.jar, c:\dev\tmp\predexedLibs\guava-15.0.jar, c:\dev\tmp\predexedLibs\okio-1.6.0.jar, c:\dev\tmp\predexedLibs\internal_impl-23.1.0.jar, c:\dev\tmp\predexedLibs\dagger-compiler-1.2.2.jar, c:\dev\tmp\predexedLibs\support-annotations-23.1.0.jar, c:\dev\tmp\predexedLibs\retrofit-2.0.0-beta3.jar, c:\dev\tmp\predexedLibs\javax.inject-1.jar, c:\dev\tmp\predexedLibs\dagger-1.2.2.jar, C:\Dev\Workspaces\workspace-java8\wod-android\target\classes, c:\dev\tmp\predexedLibs\jackson-core-2.7.0.jar, c:\dev\tmp\predexedLibs\classes.jar, c:\dev\tmp\predexedLibs\jackson-databind-2.7.0.jar, c:\dev\tmp\predexedLibs\jackson-annotations-2.7.0.jar, c:\dev\tmp\predexedLibs\javawriter-2.5.0.jar, c:\dev\tmp\predexedLibs\threetenbp-1.3.1-no-tzdb.jar, c:\dev\tmp\predexedLibs\converter-jackson-2.0.0-beta3.jar]
     [INFO] Convert classes to Dex : C:\Dev\Workspaces\workspace-java8\wod-android\target\classes.dex
    -[DEBUG] ANDROID-040-000: Executing command: Commandline = cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_66\jre\bin\java" -Xmx1024M -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.2\lib\dx.jar" --dex --no-optimize --output=C:\Dev\Workspaces\workspace-java8\wod-android\target\classes.dex C:\Users\John\.m2\repository\com\squareup\javawriter\2.5.0\javawriter-2.5.0.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cjt_threetenabp_1.0.3\classes.jar C:\Users\John\.m2\repository\com\google\guava\guava\15.0\guava-15.0.jar C:\Users\John\.m2\repository\com\squareup\dagger\dagger\1.2.2\dagger-1.2.2.jar C:\Users\John\.m2\repository\com\squareup\okio\okio\1.6.0\okio-1.6.0.jar C:\Users\John\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.7.0\jackson-core-2.7.0.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v13_23.1.0\classes.jar C:\Users\John\.m2\repository\com\squareup\dagger\dagger-compiler\1.2.2\dagger-compiler-1.2.2.jar C:\Users\John\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.7.0\jackson-databind-2.7.0.jar C:\Users\John\.m2\repository\org\threeten\threetenbp\1.3.1\threetenbp-1.3.1-no-tzdb.jar C:\Users\John\.m2\repository\com\squareup\retrofit2\retrofit\2.0.0-beta3\retrofit-2.0.0-beta3.jar C:\Users\John\.m2\repository\com\android\support\support-annotations\23.1.0\support-annotations-23.1.0.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\classes C:\Users\John\.m2\repository\com\squareup\okhttp3\okhttp\3.0.1\okhttp-3.0.1.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v4_23.1.0\libs\internal_impl-23.1.0.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v13_23.1.0\libs\internal_impl-23.1.0.jar C:\Users\John\.m2\repository\com\squareup\retrofit2\converter-jackson\2.0.0-beta3\converter-jackson-2.0.0-beta3.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v4_23.1.0\classes.jar C:\Users\John\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.7.0\jackson-annotations-2.7.0.jar C:\Users\John\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar"
    -
    -[DEBUG] ANDROID-040-000: Executed command: Commandline = cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_66\jre\bin\java" -Xmx1024M -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.2\lib\dx.jar" --dex --no-optimize --output=C:\Dev\Workspaces\workspace-java8\wod-android\target\classes.dex C:\Users\John\.m2\repository\com\squareup\javawriter\2.5.0\javawriter-2.5.0.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cjt_threetenabp_1.0.3\classes.jar C:\Users\John\.m2\repository\com\google\guava\guava\15.0\guava-15.0.jar C:\Users\John\.m2\repository\com\squareup\dagger\dagger\1.2.2\dagger-1.2.2.jar C:\Users\John\.m2\repository\com\squareup\okio\okio\1.6.0\okio-1.6.0.jar C:\Users\John\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.7.0\jackson-core-2.7.0.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v13_23.1.0\classes.jar C:\Users\John\.m2\repository\com\squareup\dagger\dagger-compiler\1.2.2\dagger-compiler-1.2.2.jar C:\Users\John\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.7.0\jackson-databind-2.7.0.jar C:\Users\John\.m2\repository\org\threeten\threetenbp\1.3.1\threetenbp-1.3.1-no-tzdb.jar C:\Users\John\.m2\repository\com\squareup\retrofit2\retrofit\2.0.0-beta3\retrofit-2.0.0-beta3.jar C:\Users\John\.m2\repository\com\android\support\support-annotations\23.1.0\support-annotations-23.1.0.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\classes C:\Users\John\.m2\repository\com\squareup\okhttp3\okhttp\3.0.1\okhttp-3.0.1.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v4_23.1.0\libs\internal_impl-23.1.0.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v13_23.1.0\libs\internal_impl-23.1.0.jar C:\Users\John\.m2\repository\com\squareup\retrofit2\converter-jackson\2.0.0-beta3\converter-jackson-2.0.0-beta3.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\unpacked-libs\cas_support-v4_23.1.0\classes.jar C:\Users\John\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.7.0\jackson-annotations-2.7.0.jar C:\Users\John\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar", Result = 0
    +[DEBUG] ANDROID-040-000: Executing command: Commandline = cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_66\jre\bin\java" -Xmx1024M -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.2\lib\dx.jar" --dex --no-optimize --output=C:\Dev\Workspaces\workspace-java8\wod-android\target\classes.dex c:\dev\tmp\predexedLibs\okhttp-3.0.1.jar c:\dev\tmp\predexedLibs\guava-15.0.jar c:\dev\tmp\predexedLibs\okio-1.6.0.jar c:\dev\tmp\predexedLibs\internal_impl-23.1.0.jar c:\dev\tmp\predexedLibs\dagger-compiler-1.2.2.jar c:\dev\tmp\predexedLibs\support-annotations-23.1.0.jar c:\dev\tmp\predexedLibs\retrofit-2.0.0-beta3.jar c:\dev\tmp\predexedLibs\javax.inject-1.jar c:\dev\tmp\predexedLibs\dagger-1.2.2.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\classes c:\dev\tmp\predexedLibs\jackson-core-2.7.0.jar c:\dev\tmp\predexedLibs\classes.jar c:\dev\tmp\predexedLibs\jackson-databind-2.7.0.jar c:\dev\tmp\predexedLibs\jackson-annotations-2.7.0.jar c:\dev\tmp\predexedLibs\javawriter-2.5.0.jar c:\dev\tmp\predexedLibs\threetenbp-1.3.1-no-tzdb.jar c:\dev\tmp\predexedLibs\converter-jackson-2.0.0-beta3.jar"
    +[DEBUG] Merged dex #1 (210 defs/178.5KiB)
    +[DEBUG] Merged dex #2 (2 defs/2.0KiB)
    +[DEBUG] Merged dex #3 (3 defs/3.8KiB)
    +[DEBUG] Merged dex #4 (44 defs/53.8KiB)
    +[DEBUG] Merged dex #5 (29 defs/68.0KiB)
    +[DEBUG] Merged dex #6 (1622 defs/1771.8KiB)
    +[DEBUG] Merged dex #7 (317 defs/251.6KiB)
    +[DEBUG] Merged dex #8 (60 defs/34.6KiB)
    +[DEBUG] Merged dex #9 (89 defs/279.6KiB)
    +[DEBUG] Merged dex #10 (570 defs/998.6KiB)
    +[DEBUG] Merged dex #11 (2 defs/17.1KiB)
    +[DEBUG] Merged dex #12 (6 defs/1.6KiB)
    +[DEBUG] Merged dex #13 (183 defs/301.5KiB)
    +[DEBUG] Merged dex #14 (34 defs/67.9KiB)
    +[DEBUG] Merged dex #15 (79 defs/61.9KiB)
    +[DEBUG] Merged dex #16 (41 defs/6.4KiB)
    +[DEBUG] Merged dex #17 (198 defs/423.0KiB)
    +[DEBUG] ANDROID-040-000: Executed command: Commandline = cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_66\jre\bin\java" -Xmx1024M -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.2\lib\dx.jar" --dex --no-optimize --output=C:\Dev\Workspaces\workspace-java8\wod-android\target\classes.dex c:\dev\tmp\predexedLibs\okhttp-3.0.1.jar c:\dev\tmp\predexedLibs\guava-15.0.jar c:\dev\tmp\predexedLibs\okio-1.6.0.jar c:\dev\tmp\predexedLibs\internal_impl-23.1.0.jar c:\dev\tmp\predexedLibs\dagger-compiler-1.2.2.jar c:\dev\tmp\predexedLibs\support-annotations-23.1.0.jar c:\dev\tmp\predexedLibs\retrofit-2.0.0-beta3.jar c:\dev\tmp\predexedLibs\javax.inject-1.jar c:\dev\tmp\predexedLibs\dagger-1.2.2.jar C:\Dev\Workspaces\workspace-java8\wod-android\target\classes c:\dev\tmp\predexedLibs\jackson-core-2.7.0.jar c:\dev\tmp\predexedLibs\classes.jar c:\dev\tmp\predexedLibs\jackson-databind-2.7.0.jar c:\dev\tmp\predexedLibs\jackson-annotations-2.7.0.jar c:\dev\tmp\predexedLibs\javawriter-2.5.0.jar c:\dev\tmp\predexedLibs\threetenbp-1.3.1-no-tzdb.jar c:\dev\tmp\predexedLibs\converter-jackson-2.0.0-beta3.jar", Result = 0

I also checked the content of the generated APK's. The only difference is the size of the classes.dex (missing 600 kb).

@hjohn
Copy link
Author

hjohn commented Jun 1, 2017

Still having this problem with 4.4.3, I try every now and then with <preDex>true</preDex>, and the final APK is still missing a lot of classes just by switching the dexing mode.

@mosabua
Copy link
Member

mosabua commented May 3, 2019

Closing old issues as part of cleanup effort. Feel free to re-open and submit a PR with fix.

@mosabua mosabua closed this as completed May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants