Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
545 views
in Technique[技术] by (71.8m points)

android - Eclipse installation failed due to invalid APK file?

I use Eclipse for develop android apps, but when run projects see this error:

Installation failed due to invalid APK file!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In my case this was caused by errors in a .jar file included my library. The .jar file was one I created and so I was able to fix it. Here is a breakdown of how the problem started and how I fixed it:

  • I made changes to another project(not the project that failed to install)
  • Exported to a .jar included ALL files in project(which was the mistake)
  • the resulting .jar replaced the one already included in my project
  • Errors occurred

to fix it:

  • Re-exported .jar file including only the src folder
  • re-built and installed just fine.

Having included all the files that were not part of the src folder caused a few duplicates in the project and .jar:

  • Example: multiple androidmanifest.xml files one local and one inside .jar

This caused the .apk to be invalid. Hope this helps someone. NOTE: this solution will only work if you have library files that you have changed and compiled yourself and have made the same mistake as I did when I included folders that were not needed.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...