使用Android库项目时构建错误

时间:2012-07-09 09:05:17

标签: android library-project

我正在尝试在github上使用这个库项目:

https://github.com/pakerfeldt/android-viewflow

这个Android库项目提供了横向扫描。

我将解释我的动作如何尝试使用此库:

  1. 我从github下载了这个项目,并导入了“viewflow”项目,其中“Existing Projects into Workspace”。 (Eclipse给出了一些错误,但我修复了它们。这不是问题。)
  2. 我创建了一个名为“test”的新android项目。
  3. 我将viewflow项目添加到我的测试项目的构建路径中。 (使用Java Build Path-> Projects-> Add)
  4. 这是我的main.xml:
  5. <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res/com.example.test"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
        <LinearLayout
            android:id="@+id/header_layout"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:orientation="vertical" >
    
            <org.taptwo.android.widget.TitleFlowIndicator
                android:id="@+id/viewflowindic"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dip"
                app:clipPadding="5dp"
                app:footerColor="#FFFFC445"
                app:footerLineHeight="2dp"
                app:footerTriangleHeight="10dp"
                app:selectedColor="#FFFFC445"
                app:selectedSize="12dp"
                app:textColor="#FFFFFFFF"
                app:textSize="11dp"
                app:titlePadding="10dp" >
            </org.taptwo.android.widget.TitleFlowIndicator>
        </LinearLayout>
    
        <org.taptwo.android.widget.ViewFlow
            android:id="@+id/viewflow"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:duplicateParentState="true" >
        </org.taptwo.android.widget.ViewFlow>
    </LinearLayout>
    

    但Eclipse给出了这些错误:

    Description Resource    Path    Location    Type
    R cannot be resolved to a variable  Main.java   /test/src/com/example/test  line 14 Java Problem
    R cannot be resolved to a variable  Main.java   /test/src/com/example/test  line 19 Java Problem
    error: No resource identifier found for attribute 'titlePadding' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
    error: No resource identifier found for attribute 'textSize' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
    error: No resource identifier found for attribute 'textColor' in package 'com.example.test' main.xml    /test/res/layout    line 15 Android AAPT Problem
    error: No resource identifier found for attribute 'selectedSize' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
    error: No resource identifier found for attribute 'selectedColor' in package 'com.example.test' main.xml    /test/res/layout    line 15 Android AAPT Problem
    error: No resource identifier found for attribute 'clipPadding' in package 'com.example.test'   main.xml    /test/res/layout    line 15 Android AAPT Problem
    error: No resource identifier found for attribute 'footerColor' in package 'com.example.test'   main.xml    /test/res/layout    line 15 Android AAPT Problem
    error: No resource identifier found for attribute 'footerLineHeight' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
    error: No resource identifier found for attribute 'footerTriangleHeight' in package 'com.example.test'  main.xml    /test/res/layout    line 15 Android AAPT Problem
    

    我导入了它的示例项目(https://github.com/pakerfeldt/android-viewflow/tree/master/viewflow-example),它运行正常!

    问题可能在于命名空间,但我无法解决这个问题。

1 个答案:

答案 0 :(得分:1)

app:selectedSize =“12dp”删除此行

相关问题