使用android兼容包android-support-v4.jar出现的一些问题
2012-01-17 17:41
447 查看
项目需要用到ViewPager,毫不犹豫的引入了官方提供的android-support-v4.jar
开发过程平淡无奇,签名打包时出现了两个问题
1.使用eclipse导出签名apk出现错误
原因:
2.使用命令行脚本生成的apk无法运行,当运行到android-support-v4.jar相关的类时,出现ClassNotFoundException
解决方法:运行dx命令时,将android-support-v4.jar加入class.dex
参考
http://stackoverflow.com/questions/7993608/i-am-getting-error-while-export-my-android-application-from-eclipse-which-use-an http://snmoney.blog.163.com/blog/static/440058201181011468397/
开发过程平淡无奇,签名打包时出现了两个问题
1.使用eclipse导出签名apk出现错误
[2011-11-03 16:07:52 - AndroidViewPager] Proguard returned with error code 1. See console [2011-11-03 16:07:52 - AndroidViewPager] Note: there were 95 duplicate class definitions. [2011-11-03 16:07:52 - AndroidViewPager] Warning: android.support.v4.os.ParcelableCompatCreatorHoneycombMR2: can't find superclass or interface android.os.Parcelable$ClassLoaderCreator [2011-11-03 16:07:52 - AndroidViewPager] Warning: android.support.v4.app.ActivityCompatHoneycomb: can't find referenced method 'void invalidateOptionsMenu()' in class android.app.Activity [2011-11-03 16:07:52 - AndroidViewPager] Warning: android.support.v4.app.ActivityCompatHoneycomb: can't find referenced method 'void dump(java.lang.String,java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])' in class android.app.Activity [2011-11-03 16:07:52 - AndroidViewPager] Warning: android.support.v4.os.ParcelableCompatCreatorHoneycombMR2: can't find referenced class android.os.Parcelable$ClassLoaderCreator [2011-11-03 16:07:52 - AndroidViewPager] Warning: android.support.v4.os.ParcelableCompatCreatorHoneycombMR2: can't find referenced class android.os.Parcelable$ClassLoaderCreator [2011-11-03 16:07:52 - AndroidViewPager] Warning: android.support.v4.view.MenuCompatHoneycomb: can't find referenced method 'void setShowAsAction(int)' in class android.view.MenuItem [2011-11-03 16:07:52 - AndroidViewPager] Warning: there were 3 unresolved references to classes or interfaces. [2011-11-03 16:07:52 - AndroidViewPager] You may need to specify additional library jars (using '-libraryjars'), [2011-11-03 16:07:52 - AndroidViewPager] or perhaps the '-dontskipnonpubliclibraryclasses' option. [2011-11-03 16:07:52 - AndroidViewPager] Warning: there were 3 unresolved references to program class members. [2011-11-03 16:07:52 - AndroidViewPager] Your input classes appear to be inconsistent. [2011-11-03 16:07:52 - AndroidViewPager] You may need to recompile them and try again. [2011-11-03 16:07:52 - AndroidViewPager] Alternatively, you may have to specify the options [2011-11-03 16:07:52 - AndroidViewPager] '-dontskipnonpubliclibraryclasses' and/or [2011-11-03 16:07:52 - AndroidViewPager] '-dontskipnonpubliclibraryclassmembers'. [2011-11-03 16:07:52 - AndroidViewPager] java.io.IOException: Please correct the above warnings first. [2011-11-03 16:07:52 - AndroidViewPager] at proguard.Initializer.execute(Initializer.java:308) [2011-11-03 16:07:52 - AndroidViewPager] at proguard.ProGuard.initialize(ProGuard.java:210) [2011-11-03 16:07:52 - AndroidViewPager] at proguard.ProGuard.execute(ProGuard.java:85) [2011-11-03 16:07:52 - AndroidViewPager] at proguard.ProGuard.main(ProGuard.java:499)
原因:
Android Compatibility library referencing classes that only exist in recent versions of the Android API解决方法:在项目的proguard.cfg文件中添加
-dontwarn **HoneycombMR2 -dontwarn **CompatICS -dontwarn **Honeycomb -dontwarn **CompatIcs* -dontwarn **CompatFroyo -dontwarn **CompatGingerbread具体要dontwarn哪些条目,可以根据报错来进行相应的修改
2.使用命令行脚本生成的apk无法运行,当运行到android-support-v4.jar相关的类时,出现ClassNotFoundException
解决方法:运行dx命令时,将android-support-v4.jar加入class.dex
%DX% --dex --output=%OUT_FOLDER%\classes.dex %OUT_CLASS_FOLDER% %THIRD_JAR%
参考
http://stackoverflow.com/questions/7993608/i-am-getting-error-while-export-my-android-application-from-eclipse-which-use-an http://snmoney.blog.163.com/blog/static/440058201181011468397/
相关文章推荐
- 使用android兼容包android-support-v4.jar出现的一些问题
- 使用android.support.design.widget.CoordinatorLayout出现空白快问题
- Android同时使用多个library时android-support-v4.jar冲突问题。
- 【android】使用部分模拟器出现兼容问题Error inflating class EditText
- (转)解决 android.support.v7.widget.GridLayout 使用 xmlns:app 出现 error 的问题
- 关于android-support-v7-appcompat.jar的使用的一些问题和解决方法
- 解决 android.support.v7.widget.GridLayout 使用 xmlns:app 出现 error 的问题
- 已解决:EditText被底部固定栏挡住,使用AndroidBug5497Workaround出现兼容问题
- android开发中使用高德地图出现的一些问题
- android fragment事务的提交使用的时候出现的一些问题。。
- Android Material Design 详解(使用support v7兼容5.0以下系统)
- 导入android-support-v7-appcompat出现问题: android:Widget.Material.ActionButton
- 关于使用MyEclipse自动生成Hibernate和Struts出现的jar不兼容的问题(antlr.collections.AST.getLine()I)
- 在使用recyclerview出现的Error:Could not find com.android.support:recyclerview-v7:25.3.1-alpha1. Required b
- Android 使用android-support-multidex解决Dex超出方法数的限制问题,让你的应用不再爆棚
- Android 使用android-support-multidex解决Dex超出方法数的限制问题,让你的应用不再爆棚
- 使用Android studio 出现的一些问题
- Android 使用android-support-multidex解决Dex超出方法数的限制问题,让你的应用不再爆棚
- Android仿新版微信主界面(使用android-support-v7兼容包,兼容2.2及其以上版本)
- Android Design Support Library 兼容库使用详解