2013-04-12 1 views
0

안녕하세요, SwipeListView 라이브러리를 사용하고 있습니다. 나는 나의 xml 파일 나도 액션 바의 셜록 라이브러리를 사용하고android.view.InflateException android-swipelistview

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res/com.example.emr" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context=".EmrLauncher" > 

    <com.fortysevendeg.android.swipelistview.SwipeListView 
     xmlns:swipe="http://schemas.android.com/apk/Location" 
     android:id="@+id/emrlist" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:listSelector="#00000000" 
     app:swipeActionLeft="reveal" 
     app:swipeBackView="@+id/back" 
     app:swipeCloseAllItemsWhenMoveList="true" 
     app:swipeFrontView="@+id/front" 
     app:swipeMode="both" 
     app:swipeOffsetLeft="40dp" 
     app:swipeOffsetRight="40dp" 
     app:swipeOpenOnLongPress="true" /> 

</RelativeLayout> 

오류를

04-12 12:53:47.189: E/AndroidRuntime(15197): FATAL EXCEPTION: main 
04-12 12:53:47.189: E/AndroidRuntime(15197): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.emr/com.example.emr.EmrLauncher}: android.view.InflateException: Binary XML file line #12: Error inflating class com.fortysevendeg.android.swipelistview.SwipeListView 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.app.ActivityThread.access$600(ActivityThread.java:123) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.os.Handler.dispatchMessage(Handler.java:99) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.os.Looper.loop(Looper.java:137) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.app.ActivityThread.main(ActivityThread.java:4424) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at java.lang.reflect.Method.invokeNative(Native Method) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at java.lang.reflect.Method.invoke(Method.java:511) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at dalvik.system.NativeStart.main(Native Method) 
04-12 12:53:47.189: E/AndroidRuntime(15197): Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class com.fortysevendeg.android.swipelistview.SwipeListView 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.view.LayoutInflater.createView(LayoutInflater.java:606) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:268) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at com.actionbarsherlock.internal.ActionBarSherlockNative.setContentView(ActionBarSherlockNative.java:119) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at com.actionbarsherlock.app.SherlockActivity.setContentView(SherlockActivity.java:229) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at com.example.emr.EmrLauncher.onCreate(EmrLauncher.java:59) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.app.Activity.performCreate(Activity.java:4465) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 
04-12 12:53:47.189: E/AndroidRuntime(15197): ... 11 more 
04-12 12:53:47.189: E/AndroidRuntime(15197): Caused by: java.lang.reflect.InvocationTargetException 
04-12 12:53:47.189: E/AndroidRuntime(15197): at java.lang.reflect.Constructor.constructNative(Native Method) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.view.LayoutInflater.createView(LayoutInflater.java:586) 
04-12 12:53:47.189: E/AndroidRuntime(15197): ... 23 more 
04-12 12:53:47.189: E/AndroidRuntime(15197): Caused by: java.lang.NumberFormatException: Invalid int: "@2131427340" 
04-12 12:53:47.189: E/AndroidRuntime(15197): at java.lang.Integer.invalidInt(Integer.java:138) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at java.lang.Integer.parse(Integer.java:375) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at java.lang.Integer.parseInt(Integer.java:366) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:123) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at android.content.res.TypedArray.getInt(TypedArray.java:254) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at com.fortysevendeg.android.swipelistview.SwipeListView.init(SwipeListView.java:164) 
04-12 12:53:47.189: E/AndroidRuntime(15197): at com.fortysevendeg.android.swipelistview.SwipeListView.<init>(SwipeListView.java:134) 
04-12 12:53:47.189: E/AndroidRuntime(15197): ... 26 more 

을 이것은 무엇입니까. swipelistview.Any 도움을 위해 필요한 모든 attr을 추가했습니다. 크게 감사하겠습니다.

+0

확실하지만 변화하지 네임 스페이스 = "http://schemas.android.com/apk/res-auto" – Pragnani

+0

@Manoj는 당신이 얻을 않았다 슬쩍 문제에 대한 해결책 –

+0

@Manoj이 문제에 대한 해결책을 찾았습니까 – Dory

답변

0

libs /에서 swipelistview jar를 사용하여 만족스럽게 해결할 수 없었으므로 외부 라이브러리 프로젝트로 소스에 연결하기 만하면됩니다.

당신은 당신의 프로젝트의 project.properties에서이 같은 필요합니다은 (빌드 환경은 개미 사용하는 가정 - 그렇지 않으면, 일식에 대한 유사한 방법이 있습니다) :

android.library.reference.1=../ThirdParty/android-swipelistview 

나는 항아리와 문제를 의심 접근 방식은 스 와이프 목록 초기화 프로그램이 컴파일 타임에 프로젝트의 리소스에 액세스 할 수 없으므로 로컬 attrs.xml 파일에서 리소스를 가져 오려고 할 때 상황이 엉망이됩니다. 참조는 /를 가리 키지 않습니다./jar가 컴파일 될 때 해당 자원이 존재하지 않기 때문입니다.

어쨌든 이것은 물건을 움직이는 데 도움이되기를 바랍니다.

관련 문제