Skip to content

Build fails with Java 8. #773

Closed
Closed

Description

@zhyi

I'm using lambda expressions in my project but build fails with this error message:

Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)

Here's pom.xml:

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>test</groupId>
    <artifactId>test</artifactId>
    <name>Test</name>
    <version>1.0</version>
    <packaging>apk</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <android.sdk.platform>26</android.sdk.platform>
    </properties>
    <dependencies>
        <dependency>
            <groupId>android</groupId>
            <artifactId>android</artifactId>
            <version>8.0.0_r2</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>com.simpligility.maven.plugins</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <version>4.5.0</version>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>
</project>

I've also tried to configure the platform version in the plug-in configuration but it doesn't work either:

<plugin>
    <groupId>com.simpligility.maven.plugins</groupId>
    <artifactId>android-maven-plugin</artifactId>
    <version>4.5.0</version>
    <extensions>true</extensions>
        <configuration>
            <sdk>
                <platform>26</platform>
            </sdk>
        </configuration>
</plugin>

Activity

  1. changed the title [-]Build fails with Java 8's lambda expression.[/-] [+]Build fails with Java 8.[/+] on Apr 27, 2018
  2. mosabua commented on May 3, 2019

    @mosabua
    Member

    This should work now with the new upcoming 4.6x release or what is in master now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions