1

我有一个要在其他项目中导入的库项目。当我尝试编译它时,控制台会这样说(红色):

[2012-07-11 13:12:53 - Library] Could not find Library.apk!

这个库包含一些自定义视图,当我尝试访问其中一个时,它给了我一个Java.lang.RuntimeException由 a 引起的android.view.InflateException,同时是由java.lang.ClassNotFoundException库上的 View 类上的 a 引起的。

有谁知道如何解决这个问题?

这是 LogCat 输出以防万一。

07-11 13:12:53.899: E/AndroidRuntime(16995): FATAL EXCEPTION: main
07-11 13:12:53.899: E/AndroidRuntime(16995): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cidaut.fragment.manager/com.cidaut.fragment.manager.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class com.cidaut.viewpagerlibrary.TabPageIndicator
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2079)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.app.ActivityThread.access$600(ActivityThread.java:132)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1157)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.os.Looper.loop(Looper.java:137)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.app.ActivityThread.main(ActivityThread.java:4575)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at java.lang.reflect.Method.invokeNative(Native Method)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at java.lang.reflect.Method.invoke(Method.java:511)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at dalvik.system.NativeStart.main(Native Method)
07-11 13:12:53.899: E/AndroidRuntime(16995): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class com.cidaut.viewpagerlibrary.TabPageIndicator
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.app.Activity.setContentView(Activity.java:1835)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at com.cidaut.fragment.manager.MainActivity.onCreate(MainActivity.java:17)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.app.Activity.performCreate(Activity.java:4465)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)
07-11 13:12:53.899: E/AndroidRuntime(16995):    ... 11 more
07-11 13:12:53.899: E/AndroidRuntime(16995): Caused by: java.lang.ClassNotFoundException: com.cidaut.viewpagerlibrary.TabPageIndicator
07-11 13:12:53.899: E/AndroidRuntime(16995):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.view.LayoutInflater.createView(LayoutInflater.java:552)
07-11 13:12:53.899: E/AndroidRuntime(16995):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
07-11 13:12:53.899: E/AndroidRuntime(16995):    ... 21 more
4

1 回答 1

1

我有同样的问题,现在通过给定的操作很清楚。

请尝试转到您的项目构建路径->订单并导出。选择您的库文件并按下按钮向上,向下。获取库文件会消除一些混乱。

于 2012-07-11T11:31:10.813 回答