- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
好的。
我正在尝试创建一个可以通过使用 maven 且仅使用 maven 来完美构建的项目。
目前,只要在实际 Java 代码中没有引用,我就面临着正在生成类并且工作正常的问题。
意思是,如果我在 documentation 中创建一个示例它有效。
一旦我做了类似的事情
Intent i = new Intent(SettingsActivity_);
然后构建失败
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project InterestingFind: Compilation failure cannot find symbol
cannot find symbol
symbol: variable DerpActivity_
location: class be.company.android.DisplayMapActivity
但是,文件确实会生成,如您在所附图片中所见,但是当在 Eclipse View 中查看项目时,它们仅被视为普通文件夹,而不是“源文件夹”。
这也许可以解释为什么它们没有被拾取,但让我有点头疼。我克隆了一个 android 原型(prototype),发布版本。
如果您认为可以帮助我解决这个问题,请提供帮助!
http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0
<parent>
<groupId>be.idamediafoundry</groupId>
<artifactId>InterestingFind-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>be.idamediafoundry</groupId>
<artifactId>InterestingFind</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>InterestingFind - Application</name>
<properties>
<androidannotations.version>3.0-SNAPSHOT</androidannotations.version>
</properties>
<repositories>
<repository>
<id>snapshots-repository</id>
<name>Sonatype oss snapshot repo</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
</dependency>
<dependency>
<groupId>de.akquinet.android.androlog</groupId>
<artifactId>androlog</artifactId>
</dependency>
<!-- JSON -->
<dependency>
<groupId> org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.5</version>
</dependency>
<!-- AndroidAnnotations -->
<dependency>
<groupId>org.androidannotations</groupId>
<artifactId>androidannotations</artifactId>
<version>${androidannotations.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.androidannotations</groupId>
<artifactId>androidannotations-api</artifactId>
<version>${androidannotations.version}</version>
</dependency>
<!-- Needed for androidannotations -->
<dependency>
<groupId>org.springframework.android</groupId>
<artifactId>spring-android-rest-template</artifactId>
<version>${spring-android-version}</version>
</dependency>
<!-- Google Play Services : Should be compiled and added to local repo -->
<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>google-play-services</artifactId>
<version>5</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.1</version>
<inherited>true</inherited>
<extensions>true</extensions>
<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>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
</plugin>
<plugin>
<artifactId>versions-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>com.android.ide.eclipse.adt.AndroidNature</projectnature>
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
</additionalProjectnatures>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>com.pyx4me</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
<execution>
<id>process-classes-with-proguard</id>
<phase>process-classes</phase>
<goals>
<goal>proguard</goal>
</goals>
<configuration>
<proguardVersion>4.4</proguardVersion>
<maxMemory>256m</maxMemory>
<injar>classes</injar>
<libs>
<lib>${rt.jar.path}</lib>
<lib>${jsse.jar.path}</lib>
</libs>
<obfuscate>true</obfuscate>
<addMavenDescriptor>false</addMavenDescriptor>
<proguardInclude>${project.basedir}/proguard.conf</proguardInclude>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard</artifactId>
<version>4.4</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-jarsigner-plugin</artifactId>
<executions>
<execution>
<id>sign-application-apk</id>
<phase>package</phase>
<goals>
<goal>sign</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<executions>
<execution>
<id>zipalign-application-apk</id>
<phase>package</phase>
<goals>
<goal>zipalign</goal>
</goals>
</execution>
</executions>
<configuration>
<release>true</release>
<zipalign>
<verbose>true</verbose>
<inputApk>${project.build.directory}/${project.artifactId}-${project.version}.apk</inputApk>
<outputApk>${project.build.directory}/${project.artifactId}-${project.version}-signed-aligned.apk</outputApk>
</zipalign>
<sign>
<debug>false</debug>
</sign>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/proguard_map.txt</file>
<type>map</type>
<classifier>release</classifier>
</artifact>
</artifacts>
</configuration>
<executions>
<execution>
<id>attach-signed-aligned</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
</execution>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.basedir}/target/generated-sources/annotations</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
父 Pom:
http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0
<groupId>be.idamediafoundry</groupId>
<artifactId>InterestingFind-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>InterestingFind - Parent</name>
<modules>
<module>InterestingFind</module>
<module>InterestingFind-it</module>
</modules>
<properties>
<platform.version>4.1.1.4</platform.version>
<android-plugin>3.5.1</android-plugin>
<spring-android-version>1.0.1.RELEASE</spring-android-version>
<sign.keystore>${project.basedir}/my-release-key.keystore</sign.keystore>
<sign.alias>
</sign.alias>
<sign.storepass>
</sign.storepass>
<sing.keypass>
</sing.keypass>
</properties>
<repositories>
<repository>
<id>codehaus-snapshots</id>
<url>http://snapshots.repository.codehaus.org</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android-test</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
<!-- Androlog is a logging and reporting library for Android -->
<dependency>
<groupId>de.akquinet.android.androlog</groupId>
<artifactId>androlog</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.1</version>
<inherited>true</inherited>
<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>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version>
<inherited>true</inherited>
<configuration>
<removeExistingSignatures>true</removeExistingSignatures>
<archiveDirectory />
<archive>${project.build.directory}/${project.build.finalName}.${project.packaging}</archive>
<verbose>true</verbose>
<certs>true</certs>
<keystore>${sign.keystore}</keystore>
<alias>${sign.alias}</alias>
<storepass>${sign.storepass}</storepass>
<keypass>${sign.keypass}</keypass>
</configuration>
</plugin>
<plugin>
<groupId>com.pyx4me</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.4</version>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard</artifactId>
<version>4.4</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<configuration>
<proguardVersion>4.4</proguardVersion>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>release</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>${android-plugin}</version>
<configuration>
<release>true</release>
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-signing-properties</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>sign.keystore</property>
<message>The 'sign.keystore' property is missing. It must
contain the path to the
keystore used to sign the
application.
</message>
</requireProperty>
<requireFilesExist>
<files>
<file>${sign.keystore}</file>
</files>
<message>The 'sign.keystore' property does not point to a
file. It must contain the
path to the keystore used to sign
the application.
</message>
</requireFilesExist>
<requireProperty>
<property>sign.alias</property>
<message>The 'sign.alias' property is missing. It must
contain the key alias used to
sign the application.
</message>
</requireProperty>
<requireProperty>
<property>sign.storepass</property>
<message>The 'sign.storepass' property is missing. It must
contain the password of
the keystore used to sign the
application.
</message>
</requireProperty>
<requireProperty>
<property>sign.keypass</property>
<message>The 'sign.keypass' property is missing. It must
contain the password of the
key used to sign the application.
</message>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>linux</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<properties>
<rt.jar.path>${java.home}/jre/lib/rt.jar</rt.jar.path>
<jsse.jar.path>${java.home}/jre/lib/jsse.jar</jsse.jar.path>
</properties>
</profile>
<!-- mac profile has to be after unix since running on mac will trigger
both -->
<profile>
<id>mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<!-- absolute path -->
<!--<rt.jar.path>/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar</rt.jar.path> -->
<!-- or with JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/ -->
<rt.jar.path>${java.home}/../Classes/classes.jar</rt.jar.path>
<jsse.jar.path>${java.home}/../Classes/jsse.jar</jsse.jar.path>
</properties>
</profile>
<profile>
<id>windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<rt.jar.path>${java.home}/jre/lib/rt.jar</rt.jar.path>
<jsse.jar.path>${java.home}/jre/lib/jsse.jar</jsse.jar.path>
</properties>
</profile>
</profiles>
编辑:更新 pom。编辑:已上传 Log file
最佳答案
嗯...在您的 maven-processor-plugin 配置中,您使用的是 AA 处理器的旧包命名(即:com.googlecode.androidannotations.AndroidAnnotationProcessor
)。
当您使用 3.0-SNAPSHOT 时,您应该修改它以使用新的:org.androidannotations.AndroidAnnotationProcessor
此外,我不确定您是否真的需要这个插件来使 AA 工作。
关于android - Maven + AndroidAnnotations 生成但无法访问类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15521639/
我正在尝试从 AndroidAnnotations 3.3.2 升级到版本 4.0.0,但在升级后让 ORMLite 工作时遇到问题。升级到 4.0.0 并构建项目后,我收到错误消息:“错误:找不到符
我想将我的应用程序的某些部分提取到库中,但 AndroidAnnotations 不允许我 ;-) 如果我有: App - uses AndroidAnnotations - uses
我在 Android Studio gradle 项目中使用 AndroidAnnotations。我目前在编译期间从 AA 得到错误输出: cannot find symbol class MyAc
我有一个扩展父 fragment (NavMenu) 的 fragment (NavMenuStats)。 这个父 fragment 重写 onCreateView 方法,如下所示: @Nullabl
我在我的应用程序中使用 AndroidAnnotations,当我尝试将额外内容放入 Intent 并启动一个使用 AndroidAnnotations 的 Activity 时,我总是会收到运行时错
我用这个expandable recycler view库和 Android 注释。并尝试使用@NonConfigurationInstance注释。在 ItemViewHolder 类构造函数中,我
我在库中有一个带注释的 Activity,它是同一库中 EventBus 事件的订阅者。它看起来像这样,大大简化了: @EActivity(resName = "activity_foo") publ
我正在使用 Android Annotations RestService 进行 API 调用。唯一的问题是我收到了一个 JSON,但我不知道如何查看该 JSON 字符串。有没有一种方法可以查看响应数
所以我想尝试新的 Android Studio 并导入我的 eclipse 项目(我生成了一个 gradle 构建文件)。效果不错。 似乎唯一不起作用的库是 AndroidAnnotations。我在
如何将自定义操作栏布局与 AndroidAnnotations 结合使用? 有效的代码: @EActivity(R.layout.activity_register_classes) public c
我正在使用 AndroidAnnotation 开发 Android 应用程序。 应用程序对我的远程 API 进行 REST 调用。所以我设置了 AA 和我的 REST 客户端。但我想编写通用代码来处
我正在尝试使用 AndroidAnnotations 的 RestClient,但是当我调用客户端中的方法之一时,出现以下错误: 04-10 10:07:23.624 7528-7528/eu.
我有一个用 @Rest 注释的类,我在另一个实例中使用它的方法,用 @RestService 注释。当我调用 Rest 客户端类的某些方法时,出现 NetworkOnMainThreadExcepti
我有一个 Android 应用程序,我想下载一个大文件。 REST API 实现是通过 AndroidAnnotations 实现的。我需要使用此 REST 客户端(由 AndroidAnnotati
我正在尝试使用 AndroidAnnotations 创建一个简单的学习项目,它将与 REST 调用一起使用。我已经按照这个教程 https://github.com/androidannotatio
我有一个继承自 ListActivity 并使用 AndroidAnnotations 的 Activity 。虽然 .onListItemClick 工作正常,但列表项的上下文菜单根本没有出现,甚至
当RoboGuice触发事件时,我的事件回调会在哪里执行,在哪个线程?例如,我有一个具有 do(@Observes OnUpdateUiEvent e) 的 Activity 。我还有一个触发新 On
好的。 我正在尝试创建一个可以通过使用 maven 且仅使用 maven 来完美构建的项目。 目前,只要在实际 Java 代码中没有引用,我就面临着正在生成类并且工作正常的问题。 意思是,如果我在 d
我正在阅读有关依赖注入(inject)的文章,发现了 2 个引起我注意的库,AndroidAnnotations 和 Dagger 2。我看到的是 AA 具有很多功能,包括 DI,但是大多数开发人员都
我在使用 AndroidAnnotations 构建 Activity 时遇到了一些麻烦。我有一个名为 TemplateActivity 的父 Activity : @EActivity(R.layo
我是一名优秀的程序员,十分优秀!