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 compilation failure due to possible badly formed compiler args in pom.xml #53

Closed
rivercartwright opened this issue Sep 18, 2020 · 2 comments · Fixed by #55 or #59
Closed

Comments

@rivercartwright
Copy link
Contributor

Describe the bug
When attempting to compile my Android app with the Jakarta Activation Maven Central component below my build fails because of invalid XML defined in the pom.xml

To Reproduce
Steps to reproduce the behaviour:

  1. Add the Jakarta Activation component to an Android application by adding the line below to the dependencies section of app/build.gradle
dependencies {
    implementation 'com.sun.activation:jakarta.activation:2.0.0-RC3'
}
  1. Try and compile the app
  2. See the compilation error
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':exampleapp:kaptGenerateStubsDebugKotlin'.
> Could not resolve all artifacts for configuration ':exampleapp:debugCompileClasspath'.
   > Failed to transform jakarta.activation-2.0.0-RC3.jar (com.sun.activation:jakarta.activation:2.0.0-RC3) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Execution failed for JetifyTransform: /Users/warwick/.gradle/caches/modules-2/files-2.1/com.sun.activation/jakarta.activation/2.0.0-RC3/fb066ef8205a8d4b4ca7c18eafc920a1e00383dd/jakarta.activation-2.0.0-RC3.jar.
         > Failed to transform '/Users/warwick/.gradle/caches/modules-2/files-2.1/com.sun.activation/jakarta.activation/2.0.0-RC3/fb066ef8205a8d4b4ca7c18eafc920a1e00383dd/jakarta.activation-2.0.0-RC3.jar' using Jetifier. Reason: JDOMParseException, message: Error on line 76: The prefix "Xlint" for element "Xlint:all" is not bound.. (Run with --stacktrace for more details.)
           Suggestions:
            - Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
            - If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).

Expected behavior
The app build correctly.

Smartphone (please complete the following information):

  • Device: Emulator running Android 11
  • OS: Android 11

Additional context

I believe the problem is caused by the way the Xlint arguments are defined in the activation/pom.xml file. They don't appear to be valid XML to me, but I am not an experienced maven user.

	    <plugin>
		<artifactId>maven-compiler-plugin</artifactId>
		<executions>
		    <execution>
			<id>default-compile</id>
			<configuration>
			    <!--
				ignore some of the errors that are
				too hard to fix for now
			    -->
			    <compilerArguments>
				<Xlint:all/>
				<Xlint:-rawtypes/>
				<Xlint:-unchecked/>
				<Xlint:-finally/>
			    </compilerArguments>
			    <showWarnings>true</showWarnings>
			</configuration>
		    </execution>
		</executions>
	    </plugin>

By contrast this is how these options are defined in the Jakarta Mail mail/pom.xml which appears to me to be valid XML.

	    <plugin>
		<artifactId>maven-compiler-plugin</artifactId>
		<configuration>
		    <compilerArgs>
			<arg>-Xlint</arg>
			<arg>-Xlint:-options</arg>
			<arg>-Xlint:-path</arg>
			<!--<arg>-Werror</arg>-->
		    </compilerArgs>
		    <showDeprecation>true</showDeprecation>
		    <showWarnings>true</showWarnings>
		</configuration>
	    </plugin>

@rivercartwright
Copy link
Contributor Author

Pull request #55

@lukasj
Copy link
Contributor

lukasj commented Oct 26, 2020

fixed by #55 and #59

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

Successfully merging a pull request may close this issue.

2 participants