我已经在eclipse中通过单个类导入了gradle项目它没有显示任何错误但是当我运行应用程序时它向我显示此错误dex路径错误
这是我的logcat
07-09 12:42:55.984: E/AndroidRuntime(12286): FATAL EXCEPTION: main
07-09 12:42:55.984: E/AndroidRuntime(12286): Process: com.sothree.slidinguppanel.demo, PID: 12286
07-09 12:42:55.984: E/AndroidRuntime(12286): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sothree.slidinguppanel.demo/com.sothree.slidinguppanel.demo.DemoActivity}: android.view.InflateException: Binary XML file line #19: Error inflating class android.support.v7.internal.widget.NativeActionModeAwareLayout
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2252)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2301)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.app.ActivityThread.access$800(ActivityThread.java:144)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.os.Handler.dispatchMessage(Handler.java:106)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.os.Looper.loop(Looper.java:136)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.app.ActivityThread.main(ActivityThread.java:5212)
07-09 12:42:55.984: E/AndroidRuntime(12286): at java.lang.reflect.Method.invokeNative(Native Method)
07-09 12:42:55.984: E/AndroidRuntime(12286): at java.lang.reflect.Method.invoke(Method.java:515)
07-09 12:42:55.984: E/AndroidRuntime(12286): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
07-09 12:42:55.984: E/AndroidRuntime(12286): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
07-09 12:42:55.984: E/AndroidRuntime(12286): at dalvik.system.NativeStart.main(Native Method)
07-09 12:42:55.984: E/AndroidRuntime(12286): Caused by: android.view.InflateException: Binary XML file line #19: Error inflating class android.support.v7.internal.widget.NativeActionModeAwareLayout
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:814)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.view.LayoutInflater.rInflate(LayoutInflater.java:745)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:299)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:246)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106)
07-09 12:42:55.984: E/AndroidRuntime(12286): at com.sothree.slidinguppanel.demo.DemoActivity.onCreate(DemoActivity.java:33)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.app.Activity.performCreate(Activity.java:5240)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2216)
07-09 12:42:55.984: E/AndroidRuntime(12286): ... 11 more
07-09 12:42:55.984: E/AndroidRuntime(12286): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.internal.widget.NativeActionModeAwareLayout" on path: DexPathList[[zip file "/data/app/com.sothree.slidinguppanel.demo-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.sothree.slidinguppanel.demo-2, /vendor/lib, /system/lib]]
07-09 12:42:55.984: E/AndroidRuntime(12286): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
07-09 12:42:55.984: E/AndroidRuntime(12286): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
07-09 12:42:55.984: E/AndroidRuntime(12286): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.view.LayoutInflater.createView(LayoutInflater.java:559)
07-09 12:42:55.984: E/AndroidRuntime(12286): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
07-09 12:42:55.984: E/AndroidRuntime(12286): ... 24 more
这是我的xml文件
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DemoActivity" >
<com.example.slidingpannel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoDragView="@+id/dragView"
sothree:umanoOverlay="true"
sothree:umanoPanelHeight="68dp"
sothree:umanoParalaxOffset="100dp"
sothree:umanoShadowHeight="4dp" >
<!-- MAIN CONTENT -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<android.support.v7.widget.Toolbar
xmlns:sothree="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_toolbar"
android:minHeight="?attr/actionBarSize"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
sothree:theme="@style/ActionBar" />
<TextView
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="270dp"
android:layout_marginTop="?attr/actionBarSize"
android:clickable="true"
android:focusable="false"
android:focusableInTouchMode="true"
android:gravity="center"
android:text="Main Content"
android:textSize="16sp" />
<LinearLayout
android:id="@+id/dragView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:clickable="true"
android:focusable="false"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:orientation="horizontal" >
<TextView
android:id="@+id/name"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:textSize="14sp" />
<Button
android:id="@+id/follow"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical|right"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textSize="14sp" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scaleType="fitStart"
android:src="@drawable/graphic" />
</LinearLayout>
</FrameLayout>
<!-- SLIDING LAYOUT -->
<LinearLayout
android:id="@+id/dragView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:clickable="true"
android:focusable="false"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:orientation="horizontal" >
<TextView
android:id="@+id/name"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:textSize="14sp" />
<Button
android:id="@+id/follow"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical|right"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textSize="14sp" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scaleType="fitStart"
android:src="@drawable/graphic" >
</ImageView>
</LinearLayout>
</com.example.slidingpannel.SlidingUpPanelLayout>
</RelativeLayout>
请帮助我,因为我在最近两天被困住了。
答案 0 :(得分:0)
我认为您在导入Android Sliding Up Panel Library时遇到问题。
在项目中添加"INSERT INTO importpending (claimer_name, status, template, last_trt, email)
(SELECT employee_name, status_new, template,
turn_around_time_set, tpa
FROM importclaims
WHERE id = $name1 AND TRT < '".$today."')";
库。
只需将以下依赖项添加到[Android Sliding Up Panel][1]
文件即可使用该库:
build.gradle
然后更改此标记
dependencies {
repositories {
mavenCentral()
}
compile 'com.sothree.slidinguppanel:library:3.0.0'
}
到
com.example.slidingpannel.SlidingUpPanelLayout