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

[4.6.0] NPE when trying to call getAndroidTargetManager #806

Open
Hanmac opened this issue Mar 16, 2022 · 0 comments
Open

[4.6.0] NPE when trying to call getAndroidTargetManager #806

Hanmac opened this issue Mar 16, 2022 · 0 comments

Comments

@Hanmac
Copy link

Hanmac commented Mar 16, 2022

try to build with JAVA 11:

JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 mvn -U -B clean -P windows-linux,android-release-build install -Dandroid.sdk.path=/home/hanmac/android-sdks/ -T 1C -DskipTests=true -e

Plugin Config in Maven pom.xml

<plugin>
                        <groupId>com.simpligility.maven.plugins</groupId>
                        <artifactId>android-maven-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>javax.xml.bind</groupId>
                                <artifactId>jaxb-api</artifactId>
                                <version>2.3.1</version>
                            </dependency>
                        </dependencies>
                        <version>4.6.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <sign>
                                <debug>false</debug>
                            </sign>
                            <sdk>
                                <platform>26</platform>
                            </sdk>
                            <zipalign>
                                <verbose>false</verbose>
                            </zipalign>
                            <dexForceJumbo>true</dexForceJumbo>
                            <androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
                            <assetsDirectory>${project.basedir}/assets</assetsDirectory>
                            <resourceDirectory>${project.basedir}/res</resourceDirectory>
                            <nativeLibrariesDirectory>${project.basedir}/libs</nativeLibrariesDirectory>
                            <extractDuplicates>true</extractDuplicates>
                            <proguard>
                                <skip>false</skip>
                                <config>${project.basedir}/proguard.cfg</config>
                            </proguard>
                            <release>true</release>
                            <dex>
                                <jvmArguments>
                                    <argument>${build.min.memory}</argument>
                                    <argument>${build.max.memory}</argument>
                                </jvmArguments>
                            </dex>
                        </configuration>
                    </plugin>

getting the following NPE:

[ERROR] Failed to execute goal com.simpligility.maven.plugins:android-maven-plugin:4.6.0:generate-sources (default-generate-sources) on project forge-gui-android: Execution default-generate-sources of goal com.simpligility.maven.plugins:android-maven-plugin:4.6.0:generate-sources failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.simpligility.maven.plugins:android-maven-plugin:4.6.0:generate-sources (default-generate-sources) on project forge-gui-android: Execution default-generate-sources of goal com.simpligility.maven.plugins:android-maven-plugin:4.6.0:generate-sources failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:829)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-generate-sources of goal com.simpligility.maven.plugins:android-maven-plugin:4.6.0:generate-sources failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:829)
Caused by: java.lang.NullPointerException
    at com.android.repository.impl.meta.SchemaModuleUtil.marshal (SchemaModuleUtil.java:264)
    at com.android.repository.impl.manager.LocalRepoLoaderImpl.writePackage (LocalRepoLoaderImpl.java:275)
    at com.android.repository.impl.manager.LocalRepoLoaderImpl.parsePackages (LocalRepoLoaderImpl.java:169)
    at com.android.repository.impl.manager.LocalRepoLoaderImpl.getPackages (LocalRepoLoaderImpl.java:124)
    at com.android.repository.impl.manager.RepoManagerImpl$LoadTask.run (RepoManagerImpl.java:517)
    at com.android.repository.api.RepoManager$DummyProgressRunner.runSyncWithProgress (RepoManager.java:397)
    at com.android.repository.impl.manager.RepoManagerImpl.load (RepoManagerImpl.java:364)
    at com.android.repository.api.RepoManager.loadSynchronously (RepoManager.java:290)
    at com.android.sdklib.repository.AndroidSdkHandler$RepoConfig.createRepoManager (AndroidSdkHandler.java:718)
    at com.android.sdklib.repository.AndroidSdkHandler.getSdkManager (AndroidSdkHandler.java:295)
    at com.android.sdklib.repository.AndroidSdkHandler.getAndroidTargetManager (AndroidSdkHandler.java:330)
    at com.simpligility.maven.plugins.android.AndroidSdk.findPlatformByApiLevel (AndroidSdk.java:129)
    at com.simpligility.maven.plugins.android.AndroidSdk.<init> (AndroidSdk.java:107)
    at com.simpligility.maven.plugins.android.AbstractAndroidMojo.getAndroidSdk (AbstractAndroidMojo.java:1172)
    at com.simpligility.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateR (GenerateSourcesMojo.java:789)
    at com.simpligility.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute (GenerateSourcesMojo.java:240)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:829)

4.6.0 and 4.5.0 cause this NPE
4.4.3 does not

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

1 participant