我创建了一个项目,将资源文件复制到该项目的库中,并将其添加到项目结构中,并指定了Theme.AppCompat
样式。
编译没有错误,但是当您启动降级异常时:
08-03 00:50:00.406: ERROR/AndroidRuntime(4055): FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:98)
at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
at com.example.SampleMetrRost.CentralActivity.onCreate(CentralActivity.java:12)
at android.app.Activity.performCreate(Activity.java:4636)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1051)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1924)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1985)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1151)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4476)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:816)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:583)
at dalvik.system.NativeStart.main(Native Method)
请帮帮我。今天花了一整天。
最佳答案
没有 Gradle (Click here for the Gradle solution)
关于android - 如何在IntelliJ IDEA中添加库(android-support-v7-appcompat),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18025942/