【问题标题】:Intellij: Use Google Play Services AAR in a mavenized projectIntellij:在 mavenized 项目中使用 Google Play Services AAR
【发布时间】:2013-12-30 14:45:36
【问题描述】:

我正在尝试将 Google Play Services 4.0.3 AAR 与 IntelliJ 13 (133.193) 一起使用 我使用了这样的安装文件:

mvn install:install-file -Dfile=$ANDROID_HOME/extras/google/m2repository/com/google/android/gms/play-services/4.0.30/play-services-4.0.30.aar -DgroupId=com.google.android.gms -DartifactId=play-services -Dversion=4.0.30 -Dpackaging=aar

并添加依赖:

<dependency>
    <groupId>com.google.android.gms</groupId>
    <artifactId>play-services</artifactId>
    <version>4.0.30</version>
    <type>aar</type>
</dependency>

当从 CLI 运行 mvn install 时,它似乎编译得很好,但是 IntelliJ 无法包含该包并为其提供检查/自动完成,并且所有符号都显示错误/无法识别。 包确实显示在“依赖项”下的 Maven 面板上,但不显示在外部库下的项目面板中。

使用 android-maven-plugin 3.8.1

【问题讨论】:

  • 以防万一 - 你试过 Android Studio 吗?
  • 我不确定这个想法是否支持新的 Android 库文件格式。但很可能是 gradle 插件

标签: android maven intellij-idea


【解决方案1】:

AAR 支持现已在 IntelliJ IDEA 13.0.2 EAP 中提供

【讨论】:

    【解决方案2】:

    我通过将android-maven-plugin 添加到我的pom.xml 中解决了这个问题(请注意,添加这些部分后,您需要将maven 导入到您的项目中):

    <project>
    
        <build>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                        <artifactId>android-maven-plugin</artifactId>
                        <version>3.8.2</version>
                        <extensions>true</extensions>
                    </plugin>
                </plugins>
            </pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <configuration>
                        <sdk>
                            <platform>19</platform>
                        </sdk>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多