gpt4 book ai didi

java - Android 与 maven ? Apk 未知

转载 作者:搜寻专家 更新时间:2023-10-30 21:01:16 31 4
gpt4 key购买 nike

无法让 Android 与 Maven 一起工作。可能是什么问题(从 maven quickstart 原型(prototype)生成):

<?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>asd</groupId>
<artifactId>asd</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<name>asd</name>

<properties>
<platform.version>4.0.3</platform.version>
</properties>

<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>15</platform>
</sdk>
<emulator>
<avd>Android4</avd>
</emulator>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

导致:

Project build error: Unknown packaging: apk

+

Project build error: Unresolveable build extension: Plugin 
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.2.0 or one of its
dependencies could not be resolved: Failed to collect dependencies for
com.jayway.maven.plugins.android.generation2:android-maven-plugin:jar:3.2.0 ()

最佳答案

我遇到了同样的问题,因为我在 <build><pluginManagement> 中添加了 android 插件配置部分。

将其移动到 <build><plugins>解决了我的问题。

关于java - Android 与 maven ? Apk 未知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10610564/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com