Java 在下面的棒棒糖中获取NoClassDefFoundError

Java 在下面的棒棒糖中获取NoClassDefFoundError,java,android,android-studio,Java,Android,Android Studio,我正在使用Android Studio 1.3。我已经安装了最新的SDK(23),之后我在运行时遇到了一些错误android.view.InflateException和NoClassDefFoundError。这些错误不会发生在棒棒糖中,但会发生在Kitkat上 在安装SDK 23之前,我在Kitkat设备上没有收到任何错误 现在我的身材等级是 apply plugin: 'com.android.application' android { compileSdkVersion 23

我正在使用Android Studio 1.3。我已经安装了最新的SDK(23),之后我在运行时遇到了一些错误android.view.InflateExceptionNoClassDefFoundError。这些错误不会发生在棒棒糖中,但会发生在Kitkat上

在安装SDK 23之前,我在Kitkat设备上没有收到任何错误

现在我的身材等级是

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    defaultConfig {
        applicationId "com.nanonino.notifeye"
        minSdkVersion 14
        targetSdkVersion 23
        multiDexEnabled true
        renderscriptTargetApi 23
        renderscriptSupportModeEnabled true
        compileOptions {

            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile project(':library')
    compile project(':Materialtimepicker')
    compile project(':main')
    compile project(':library1')
    compile 'com.google.android.gms:play-services:+'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:cardview-v7:23.+'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.picasso:picasso:2.4.0'
    compile 'com.android.support:support-v4:23.0.0'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'org.apache.httpcomponents:httpmime:4.2.3'
}
错误日志为

08-28 15:16:30.012  29750-29750/com.nanonino.notifeye E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.nanonino.notifeye, PID: 29750
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nanonino.notifeye/com.nanonino.notifeye.signup_login.SignuporLoginActivity}: android.view.InflateException: Binary XML file line #71: Error inflating class com.nanonino.notifeye.Utills.TypefacedTextViewrlight
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2235)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2285)
            at android.app.ActivityThread.access$800(ActivityThread.java:138)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:149)
            at android.app.ActivityThread.main(ActivityThread.java:5077)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.view.InflateException: Binary XML file line #71: Error inflating class com.nanonino.notifeye.Utills.TypefacedTextViewrlight
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
            at android.app.Activity.setContentView(Activity.java:1995)
            at com.nanonino.notifeye.signup_login.SignuporLoginActivity.onCreate(SignuporLoginActivity.java:86)
            at android.app.Activity.performCreate(Activity.java:5395)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2285)
            at android.app.ActivityThread.access$800(ActivityThread.java:138)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:149)
            at android.app.ActivityThread.main(ActivityThread.java:5077)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
有人能帮我解决这个问题吗?

这是我的TypefacedTextViewrlight.java

package com.nanonino.notifeye.Utills;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;

public class TypefacedTextViewrlight extends TextView {

    public TypefacedTextViewrlight(Context context) {
        super(context);
        style(context);
    }

    public TypefacedTextViewrlight(Context context, AttributeSet attrs) {
        super(context, attrs);
        style(context);
    }

    public TypefacedTextViewrlight(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        style(context);
    }

    private void style(Context context) {
        Typeface tf = Typeface.createFromAsset(context.getAssets(),
                "Roboto-Light.ttf");
        setTypeface(tf);
    }

}
下面是我的xml文件(activity\u signuporlogin.xml



在第71行的xml文件中,您使用的是com.nanonino.notifeye.Utills.TypefacedTextViewrlight。问题在于观点。你可以发布你的xml文件吗?你也可以发布TypefacedTextViewrlight类文件吗?我已经发布了@Sureshkumaru,通常堆栈跟踪会稍微长一点,指出了视图膨胀失败的原因。您可以再次检查console/logcat输出吗?我发现,从我的包名创建的类中发生了错误。如果我将一个类调用到另一个类,则会发生此错误。例如,我将TypefacedTextViewrlight.java文件调用到xml中。我出错了。如果我调用任何异步任务。我也犯了同样的错误NoClassDefFoundError@Capricorn
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF"
    android:orientation="vertical">


    <RelativeLayout
        android:id="@+id/relativelayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:visibility="visible">

        <TextView
            android:id="@+id/Takeatour"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:gravity="center"
            android:text="TAKE A TOUR"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#78B452"
            android:textStyle="bold"
            android:visibility="invisible" />

        <Button
            android:id="@+id/btnSignup"
            android:layout_width="fill_parent"
            android:layout_height="40dp"
            android:layout_below="@+id/Takeatour"
            android:layout_marginBottom="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/blackbackgroundbutton"
            android:text="START YOUR 30-DAY FREE TRIAL"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="#ffffff"
            android:visibility="invisible" />

        <LinearLayout
            android:id="@+id/linearLayout1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/btnSignup"
            android:layout_marginBottom="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:orientation="horizontal"
            android:visibility="invisible">

            <View
                android:id="@+id/view1"
                android:layout_width="wrap_content"
                android:layout_height="1dp"
                android:layout_gravity="center_vertical"
                android:layout_weight="1"
                android:background="#B3B3B3" />

            <com.nanonino.notifeye.Utills.TypefacedTextViewrlight
                android:id="@+id/textView2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="  OR  "
                android:textColor="#808080" />

            <View
                android:id="@+id/view2"
                android:layout_width="wrap_content"
                android:layout_height="1dp"
                android:layout_gravity="center_vertical"
                android:layout_weight="1"
                android:background="#B3B3B3" />
        </LinearLayout>

        <Button
            android:id="@+id/subscribe"
            android:layout_width="fill_parent"
            android:layout_height="40dp"
            android:layout_below="@+id/linearLayout1"
            android:layout_marginBottom="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/orangebackgroundbutton"
            android:text="SUBSCRIBE NOW"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="#ffffff"
            android:visibility="invisible" />

        <Button
            android:id="@+id/txtLogin"
            android:layout_width="fill_parent"
            android:layout_height="40dp"
            android:layout_below="@+id/subscribe"
            android:layout_marginBottom="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/emailbuttonpressed"
            android:text="ALREADY REGISTERED? LOG IN"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="#ffffff"
            android:visibility="invisible" />
    </RelativeLayout>

    <ImageView
        android:id="@+id/ivLogo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/relativelayout"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:src="@drawable/logo"
        android:visibility="invisible" />

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/relativelayout"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:src="@drawable/logo"
        android:visibility="invisible" />

</RelativeLayout>