2017-08-19 7 views
0

新しいアプリの問題に直面しています。私は、ショッピングカートのためのアプリを作成し、私はサインインし、サインアップページを作成し、それは今のエラーメッセージjava.lang.NoClassDefFoundError:解決策の失敗:Landroid/support/v4/view/animation/FastOutSlowInInterpolator;

エラー表示されます。XML It is opening and working properly

activity_main Build.gradle

apply plugin: 'com.android.application' 
android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
    applicationId "com.example.dinidev.ecom" 
    minSdkVersion 15 
    targetSdkVersion 25 
    versionCode 1 
    versionName "1.0" 
    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
} 
dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 

compile 'com.android.support:design:25.3.1' 
compile 'com.android.support:cardview-v7:25.3.1' 
compile 'com.android.support:support-v4:25.3.1' 
compile 'com.android.support:recyclerview-v7:25.3.1' 
compile 'com.google.code.gson:gson:2.2.4' 
compile 'com.android.support:multidex:1.0.1' 

testCompile 'junit:junit:4.12' 
}`Code` 

08-19 18:56:41.279 2902-2902/com.example.dinidev.ecom E/AndroidRuntime: FATAL EXCEPTION: main `Error` 
                    Process: com.example.dinidev.ecom, PID: 2902 
                    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dinidev.ecom/com.example.dinidev.ecom.Signin}: android.view.InflateException: Binary XML file line #32: Binary XML file line #32: Error inflating class android.support.design.widget.TextInputLayout 
                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646) 
                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) 
                     at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) 
                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                     at android.os.Looper.loop(Looper.java:154) 
                     at android.app.ActivityThread.main(ActivityThread.java:6077) 
                     at java.lang.reflect.Method.invoke(Native Method) 
                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
                    Caused by: android.view.InflateException: Binary XML file line #32: Binary XML file line #32: Error inflating class android.support.design.widget.TextInputLayout 
                    Caused by: android.view.InflateException: Binary XML file line #32: Error inflating class android.support.design.widget.TextInputLayout 
                    Caused by: java.lang.reflect.InvocationTargetException 
                     at java.lang.reflect.Constructor.newInstance0(Native Method) 
                     at java.lang.reflect.Constructor.newInstance(Constructor.java:430) 
                     at android.view.LayoutInflater.createView(LayoutInflater.java:645) 
                     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787) 
                     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) 
                     at android.view.LayoutInflater.rInflate(LayoutInflater.java:858) 
                     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) 
                     at android.view.LayoutInflater.rInflate(LayoutInflater.java:861) 
                     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) 
                     at android.view.LayoutInflater.inflate(LayoutInflater.java:518) 
                     at android.view.LayoutInflater.inflate(LayoutInflater.java:426) 
                     at android.view.LayoutInflater.inflate(LayoutInflater.java:377) 
                     at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:414) 
                     at android.app.Activity.setContentView(Activity.java:2414) 
                     at com.example.dinidev.ecom.Signin.onCreate(Signin.java:16) 
                     at android.app.Activity.performCreate(Activity.java:6662) 
                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) 
                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599) 
                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) 
                     at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) 
                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                     at android.os.Looper.loop(Looper.java:154) 
                     at android.app.ActivityThread.main(ActivityThread.java:6077) 
                     at java.lang.reflect.Method.invoke(Native Method) 
                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
                    Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/view/animation/FastOutSlowInInterpolator; 
                     at android.support.design.widget.AnimationUtils.<clinit>(AnimationUtils.java:30) 
                     at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:200) 
                     at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:183) 
                     at java.lang.reflect.Constructor.newInstance0(Native Method)  
                     at java.lang.reflect.Constructor.newInstance(Constructor.java:430)  
                     at android.view.LayoutInflater.createView(LayoutInflater.java:645)  
                     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)  
                     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)  
                     at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)  
                     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)  
                     at android.view.LayoutInflater.rInflate(LayoutInflater.java:861)  
                     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)  
                     at android.view.LayoutInflater.inflate(LayoutInflater.java:518)  
                     at android.view.LayoutInflater.inflate(LayoutInflater.java:426)  
                     at android.view.LayoutInflater.inflate(LayoutInflater.java:377)  
                     at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:414)  
                     at android.app.Activity.setContentView(Activity.java:2414)  
                     at com.example.dinidev.ecom.Signin.onCreate(Signin.java:16)  
                     at android.app.Activity.performCreate(Activity.java:6662)  
                     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)  
                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)  
                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)  
                     at android.app.ActivityThread.-wrap12(ActivityThread.java)  
                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)  
                     at android.os.Handler.dispatchMessage(Handler.java:102)  
                     at android.os.Looper.loop(Looper.java:154)  
                     at android.app.ActivityThread.main(ActivityThread.java:6077)  
                     at java.lang.reflect.Method.invoke(Native Method)  
                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)  
                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)  
08-19 18:56:41.279 2902-2902/com.example.dinidev.ecom E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.animation.FastOutSlowInInterpolator" on path: DexPathList[[zip file "/data/app/com.example.dinidev.ecom-2/base.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.dinidev.ecom-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.dinidev.ecom-2/lib/x86, /system/lib, /vendor/lib]] 
                     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 
                     at java.lang.ClassLoader.loadClass(ClassLoader.java:380) 
                     at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 
                      ... 30 more 

モジュールのアプリを

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/profile1" 
tools:context="com.example.dinidev.ecom.MainActivity"> 


<Button 
    android:id="@+id/guest" 
    android:layout_width="168dp" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/signin" 
    android:layout_centerHorizontal="true" 
    android:layout_marginBottom="31dp" 
    android:background="@android:color/holo_blue_light" 
    android:clickable="true" 
    android:text="@string/Guest_User" 
    android:textColor="@color/white" 
    android:textSize="@dimen/eighteen_sp" 
    android:textStyle="bold" 
    app:layout_constraintRight_toRightOf="parent" 
    tools:layout_editor_absoluteY="487dp" /> 


<Button 
    android:id="@+id/signin" 
    android:layout_width="178dp" 
    android:layout_height="wrap_content" 
    android:layout_alignBaseline="@+id/signup" 
    android:layout_alignBottom="@+id/signup" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_marginLeft="12dp" 
    android:layout_marginStart="12dp" 
    android:background="@android:color/holo_blue_light" 
    android:clickable="true" 
    android:text="@string/login" 
    android:textColor="@color/white" 
    android:textSize="@dimen/eighteen_sp" 
    android:textStyle="bold" 
    tools:layout_editor_absoluteX="8dp" 
    tools:layout_editor_absoluteY="487dp" /> 

<Button 
    android:id="@+id/signup" 
    android:layout_width="168dp" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentEnd="true" 
    android:layout_alignParentRight="true" 
    android:layout_marginBottom="27dp" 
    android:layout_marginEnd="12dp" 
    android:layout_marginRight="12dp" 
    android:background="@android:color/holo_blue_light" 
    android:clickable="true" 
    android:text="@string/New_User" 
    android:textColor="@color/white" 
    android:textSize="@dimen/eighteen_sp" 
    android:textStyle="bold" 
    app:layout_constraintRight_toRightOf="parent" 
    tools:layout_editor_absoluteY="487dp" /> 
</RelativeLayout> 

login_page xml It is not opening

<?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" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:background="@drawable/login_background"> 

    <TextView 
     android:id="@+id/loginPage_logo" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="@dimen/fourty_seven_dp" 
     android:text="@string/logo" 
     android:textColor="@color/white" 
     android:textSize="@dimen/fourty_four_sp" 
     android:textStyle="italic|bold"/> 
</RelativeLayout> `It is not opening it shows error as app stopped working message` 

MainActivityクラス

主な活動は正常に動作しているが、私はそれがインスタンスを保存示してラインをデバッグするとき、それは、アクション

package com.example.dinidev.ecom; 
import android.content.Context; 
import android.content.Intent; 
import android.support.v7.app.AppCompatActivity; 
import android.os.Bundle; 
import android.view.View; 
import android.widget.Button; 
public class MainActivity extends AppCompatActivity { 
Button signin; 
final Context context = this; 
@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_main); 
    addListenerOnButton(); 
} 

private void addListenerOnButton() { 
    /** Login Button Click */ 
    signin = (Button) findViewById(R.id.signin); 
    signin.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View v) { 
      Intent intent = new Intent(context, Signin.class); 
      startActivity(intent); 
     } 
    }); 
} 

サインインもクラス

を停止し、ログインをクリックしたときに:ヌルメッセージ

package com.example.dinidev.ecom; 
import android.app.Activity; 
import android.os.Bundle; 
public class Signin extends Activity{ 
@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.login_page); 
} 
} 

Androidmanifest

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.example.dinidev.ecom"> 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
<uses-permission android:name="android.permission.INTERNET" /> 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:roundIcon="@mipmap/ic_launcher_round" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 
    <activity android:name=".MainActivity"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 

    <activity 
     android:label="@string/register_label" 
     android:name=".Signup"> 
    </activity> 
    <activity 
     android:label="@string/register_label" 
     android:name=".Signin"> 
    </activity> 

</application> 

+0

テキスト入力エラーを取得している正確にすべての依存関係を実装し、プロジェクトをきれいにし、これを再構築している確認してくださいそして、あなたのアプリケーションを実行し、それは願っていますあなたの問題を解決してください –

答えて

0

は、あなたのアプリケーションでmultiDexを含める必要があります。 マニフェストには、MulitiDexApplicationは含まれていません。

あなたのエラーコードです。この行を参照してください。

Didn't find class "android.support.v4.view.animation.FastOutSlowInInterpolator" on path: DexPathList[ 

これをあなたの依存関係に追加します。

compile 'com.android.support:multidex:1.0.1' 

あなたのGradleには、multiDexEnabledが追加されます。

android { 
    defaultConfig { 
     ... 
     minSdkVersion 21 
     targetSdkVersion 26 
     multiDexEnabled true // add this line 
    } 
    ... 
} 

あなたのmanifestでは、multiDexアプリケーションクラスを追加します。

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.myapp"> 
    <application 
      android:name="android.support.multidex.MultiDexApplication" > 
     ... 
    </application> 
</manifest> 

最後に、プロジェクトをきれいにして再構築します。詳細情報については

https://developer.android.com/studio/build/multidex.html

はそれが役に立てば幸い:)

+0

あなたの問題を解決するのに役立つ場合は、受け入れられた回答としてマークしてください。それは他人を助けるでしょう。 –

関連する問題