使用Maven开发Android的常见问题

时间 : 15-10-04 栏目 : Android, Jenkins, 移动开发, 集成测试 作者 : noway 评论 : 0 点击 : 499 次

高效建立健壮的Android应用-Maven Android 开发文中提到,Maven in Android 听起来很牛逼,你是不是很想马上弄个HelloWorld,但是你可能要懊恼了,因为你马上回碰到Project build error: Unknown packaging: apk的错误,然后就停在这里了,我之前也是因为碰到这个问题就停了,然后就想骂人,特别是那个引诱你尝试的那个人(比如我),好了。这就是本文的来源。本文也会对不断碰到的问题进行总结,你有特别的问题也可用提出来,我到时候进行总结.

问题集合

1.Project build error: Unknown packaging: apk,在Eclipse中安装m2e-android插件

安装源:http://rgladwell.github.com/m2e-android/updates/ 安装方法:Help -> Install new Software -> 在出来的对话框中点击 Add -> Name:m2e-android Location:http://rgladwell.github.com/m2e-android/updates/ 然后就下一步下一步了,你懂的. 也可以通过: Preferences -> Maven -> Discovery and click "Open Catalog".然后选择 m2e android connector 安装好以后就可以解决这个问题了

2.maven-resources-plugin prior to 2.4 is not supported by m2e. Use maven-resources-plugin version 2.4 or later.

在项目的pom.xml中修改你的org.apache.maven.plugins的版本号,可直接复制下面那一段更新 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.5</version> <configuration> <encoding>${project.build.sourceEncoding}</encoding> </configuration> </plugin>

3.dependency=[com.actionbarsherlock:library:apklib:4.1.0:compile] not found in
workspace

com.actionbarsherlock.library 换了artifactId了,是actionbarsherlock,并且使用4.4.0的版本..

4.Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.0:consume-
aar (execution: default-consume-aar, phase: compile)

好了,在你的maven配置里,增加如下一段即可解决:

org.eclipse.m2e
lifecycle-mapping
1.0.0

com.jayway.maven.plugins.android.generation2
android-maven-plugin
3.5.0

manifest-update

5.No Android SDK path could be found.

在settings.xml里面添加(如果你连settings.xml都没的话请点这里

<profiles> <profile> <id>android</id> <properties> <android.sdk.path> /Users/lily/android-sdk-macosx <!-- 此处为自己sdk路径 --> </android.sdk.path> </properties> </profile> </profiles> <activeProfiles> <!--make the profile active all the time --> <activeProfile>android</activeProfile> </activeProfiles>

6.@Override 的代码全部都报错

默认Maven中的JAVA版本是1.5,只要修改成1.6就好了 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin>

7.java.lang.ClassNotFoundException: org.sonatype.aether.RepositorySystem

使用最新版本的Maven3.1.1,使用3.8的android-maven-plugin <plugin> <groupId>com.jayway.maven.plugins.android.generation2</groupId> <artifactId>android-maven-plugin</artifactId> <version>${android.plugin.version}</version> <extensions>true</extensions> <configuration> <sdk> <platform>16</platform> </sdk> </configuration> </plugin>

8.

maven和android-maven-plugin版本不匹配,常常会出现的错误(答案就在问题里面哦)

http://stackoverflow.com/questions/19174392/failed-to-execute-goal-com-jayway-maven-plugins-android-generation2

Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources (default-generate-sources) on project my-android-application: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources failed: A required class was missing while executing com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.6.0:generate-sources: Lorg/sonatype/aether/RepositorySystem;

本文标签 ,

除非注明,文章均为( noway )原创,转载请保留链接: http://blog-old.z3a105.com/?p=599

使用Maven开发Android的常见问题:等您坐沙发呢!

发表评论





       ==QQ:122320466==

 微信    QQ群


0

Aujourd’hui, une partie avec le développement du e-commerce, achats en ligne est devenu une partie de la vie pour beaucoup de gens. La mariage a commencé achats en ligne. Si vous choisissez achats les mariages en ligne, il peut être beaucoup moins cher que le salon de la Robe de mariée pas chermariée local, réduisant le budget de mariage. vous pouvez avoir beaucoup de choix si acheter de mariage en ligne. vous pouvez ramasser une robe de mariée bon marché sur Internet.
Piercing fascinerande figur, och nu tittar vi på 2016 senast brudklänning, kan du vara den vackraste bruden det!2016 senaste Bra brudklänning, söt temperament Bra design, romantiska spetsar blomma kjol, som du lägger till en elegant och charmig temperament.Kvinnan tillbaka mjuka linjer, människor brudklänningofta få en känsla av oändlig frestelse. Fall 2016 mässan, lämnar uppgifter om ditt bröllop charmig.
Yesterday afternoon, the Chinese team was training in the Guangzhou Gymnasium, when the reporter asked Zhao Yunlei the feeling of wearing the new cheap jersey , cheap jerseys online shopshe readily took a shirt from the bag crumpled ball to reporters, and she said with a smile: ” This shirt is light. ”Zhao Yunlei said: “Our material is very light like with the clothes of the tennis King Nadal, Federer, after the sweat, sweat does not drip down to the ground, when we do move, it is easy pace slipping if the sweat drip on the floor.”Tennis players Zhang Yawen, told reporters: “You might think the clothes attached to the body, fearing we swing will be affected, in fact, we do not feel anything, because the clothes are very light, very soft, put on quite comfortable. And it’s particularly good clothes to dry, washing and will dry in 15 minutes. ”
China’s sports enthusiasts NFL sweatshirt with mad love and the pursuit of, and therefore, NFL jerseys have a good market in China and development. China is a populous country, is the consumer, the economic momentum is so good, the sales prospects sportswear is immeasurable. With hot sales sweatshirt, but also to promote the importance of sports fans, on health, on the other hand is a matter of concern for the World Cup, fans wearing NFL jerseys and also can express themselves more fully love and obsession Therefore, NFL jerseys Wholesale jerseys online shopwholesale has good prospects and development in China.
ANTA-ANTA Sports Products Limited, referred to as ANTA Sports, Anta, is China’s leading sporting goods companies, mainly engaged in the design, development, manufacture and marketing of ANTA brand sporting goods, including sports footwear, apparel and accessories. Anta sweatshirt design advantages, warm stretch knit fabric, using Slim version of model, more personal fit, bid farewell to bloated, so wearing more stylish.GUIRENNIAO-This logo is a spiritual totem, smooth graphics implication unstoppable force; flexible deliver an elegant arc Wholesale jerseys china shop movement, strength and speed of the United States, a symbol of passion and rationality publicity “Heart” and “meaning”, “concept” unity; pass the fearless and enterprising mind, showing beyond the realm of self, to unstoppable force to create the future.XTEP-Xtep (China) Co., Ltd. is a comprehensive development wholesale jerseys china shop, production and marketing of Xtep brand (XTEP) sports shoes, clothing, bags, caps, balls, socks mainly large sporting goods industry enterprises.
There are a lot of fans in identifying the authenticity of the above cheap jerseys have great distress, so here to i will show you some methods to definitely affordable inexpensive cheap jerseys : Firstly, we should look at if it is working fine. China has been called the world’s factory, a lot cheap jerseys factories in China have foundries, but our cheap jerseys are all from here! Secondly, should to see whether it is the , we all know that it is difficult to get out of print once a genuine cheap cheap jerseys free shipping jersey was print. and we have all kind of stocka on the whole website, in other words, we have all you want ! Finally, look at the price, our price is not necessarily the lowest in the whole website but it must be most fair on the whole website, we certainly you will not regret later when you buy it. Of course, except that cheap jerseys, we also have the other products, such as socks, leggings and some other related products, everyone can enjoy the best services of here!

KUBET