开发环境idea-14,然后已经添加了v7目录下面的v4和v7包到项目的libs目录,并且添加到Libraries中.实在想不到是什么地方出问题了,等大神,谢谢 报错信息: java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable at android.support.v7.app.DrawerArrowDrawable.<init>(DrawerArrowDrawable.java:64) at android.support.v7.app.ActionBarDrawerToggle$DrawerArrowDrawableToggle.<init>(ActionBarDrawerToggle.java:469) at android.support.v7.app.ActionBarDrawerToggle.<init>(ActionBarDrawerToggle.java:222) at android.support.v7.app.ActionBarDrawerToggle.<init>(ActionBarDrawerToggle.java:150) at com.xxx.MainActivity$3.<init>(MainActivity.java:130) at com.xxx.MainActivity.onCreate(MainActivity.java:129) at android.app.Activity.performCreate(Activity.java:5231) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) at android.app.ActivityThread.access$800(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method) activity文件: mDrawerToggle = new ActionBarDrawerToggle(MainActivity.this, mDrawerLayout, R.string.drawer_open, R.string.drawer_close) { /** Called when a drawer has settled in a completely closed state. */ public void onDrawerClosed(View view) { super.onDrawerClosed(view); getActionBar().setTitle("oncreate close"); invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu() } /** Called when a drawer has settled in a completely open state. */ public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); getActionBar().setTitle("oncreate open"); invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu() } }; mDrawerLayout.setDrawerListener(mDrawerToggle); styles.xml <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AnimationFade"> <!-- PopupWindow left right tanchu xiaoguo. --> <item name="android:windowEnterAnimation"> @anim/in_lefttoright </item> <item name="android:windowExitAnimation"> @anim/out_righttoleft </item> </style> </resources> androidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xxxxxx" android:versionCode="1" android:versionName="1.1"> <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="21" /> <uses-permission android:name="android.permission.INTERNET"/> <application android:label="@string/app_name" android:icon="@drawable/ic_launcher"> <activity android:name="com.xxx.MainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest> |
|
对了,忘了说,我是准备做一个点击抽屉关闭的效果,抽屉目前是可以打开了,只是再次点击按钮打不开,等大神
|
|
10分 |
你的v4也一样要导入哦
|
10分 |
你看看是不是依赖包的问题 appcompat_v7
|
10分 |
v7依赖建立有问题
|
已经导入了。。
|
|
具体有其它替换的办法吗
|
|
明明导入了的
|
|
10分 |
你看看,是不是重复导入。。。
或者是不是引用了V7的工程。引入工程的话一样算导入包的。 某些版本,创建工程的话默认引用V7工程的。 |
我更新一下v7的包试试 |