2017-07-18 17 views
1

私のプロジェクトにはクラスが含まれていますが、すべてがビルドされていますが、実行時にクラッシュしてクラスを見つけることができないという奇妙な問題があります。ここでSlidingUpPanelLayoutAndroidスタジオはランタイム中にクラスを見つけることができません

https://github.com/umano/AndroidSlidingUpPanel

を使用して

Imがクラッシュです:ここでは

  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)  
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)  
     at dalvik.system.NativeStart.main(Native Method)  
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.sothree.slidinguppanel.SlidingUpPanelLayout" on path: DexPathList[[zip file "/data/app/com.example.ns.app-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.ns.app-1, /vendor/lib, /system/lib]] 
     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53) 
     at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 
     at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 
     at android.view.LayoutInflater.createView(LayoutInflater.java:559) 
     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) 
     at android.view.LayoutInflater.inflate(LayoutInflater.java:469)  
     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)  
     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)  
     at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:288)  
     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)  
     at com.example.ns.app.MainActivity.onCreate(MainActivity.java:92)  
     at android.app.Activity.performCreate(Activity.java:5133)  
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)  
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2227)  

はGradleのです:

apply plugin: 'com.android.application' 

    android { 
    compileSdkVersion 24 
    buildToolsVersion "23.0.3" 
    dexOptions { 
     javaMaxHeapSize "8g" 
    } 
    defaultConfig { 
     applicationId "com.example.ns.app" 
     minSdkVersion 16 
     targetSdkVersion 24 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
multiDexEnabled true 
    } 
    buildTypes { 
     release { 
    minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    packagingOptions { 
     exclude 'META-INF/maven/commons-io/commons-io/pom.xml' 
     exclude 'META-INF/maven/commons-io/commons-io/pom.properties' 
    } 
    configurations.all { 
     resolutionStrategy.dependencySubstitution { 
      substitute module('org.apache.commons:commons-io:1.3.2') with  module('commons-io:commons-io:1.3.2') 
     } 
     } 
    } 



    dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    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:24.2.1' 
    compile 'com.android.support:design:24.2.1' 
    compile 'com.android.support:support-v4:24.2.1' 
    testCompile 'junit:junit:4.12' 
    compile 'com.github.amigold.fundapter:library:1.0' 
    compile 'org.osmdroid:osmdroid-android:5.6.4' 
    compile 'com.google.android.gms:play-services-location:9.6.1' 
    compile 'com.sothree.slidinguppanel:library:3.3.1' 
    compile 'org.apache.commons:commons-io:1.3.2' 
    compile 'com.google.android.gms:play-services:11.0.2' 
    } 
+0

プロジェクトのクリーニングを再試行してください。また、アンドロイドサポートライブラリのバージョンtargetSdkVersionとbuidToolsVersionを同じAPIレベルにするようにしてください。 –

+0

私はそれを約1000回も同じ問題で掃除しました。おそらく、このばかなdalvik.system.BaseDexClassLoaderと何か関係があります。 –

+0

Androidプログラミングは、そのような自由な悪夢です。私は彼らが自走車を作っていることを知っています。これは、Googleがソフトウェアを開発する方法であれば、そのことを運転する人は誰でも確実に死ぬでしょう。 –

答えて

0
defaultConfig { 
     applicationId "com.ignite.a01hw909350.kolamdemo" 
     minSdkVersion 17 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     ndk { 
      abiFilters "armeabi-v7a", "x86", "armeabi", "mips" 
     } 
    } 

追加あなたのbuild.gradleアプリモジュールのabiFiltersプロジェクトの同期化とクリーンアップ

+0

sagar、ありがとう、私はそれを試みたが、私は電話でそれを実行するとまだクラッシュしたが、同じことがクラッシュせずにエミュレータで実行されます。しかし、エミュレータのログにこの警告が表示されていることがわかりました。「ClassLoaderは未知のパスを参照しました:/data/app/com.example.ns.app-2/lib/x86」私はapp-2が何であるか知りません。これ以上のアイデア? –

+0

私はこの問題に時々直面します。上記の解決策は時々動作します。しかし、それがうまくいかない場合、我々は両方とも同じ船で航海しています。 –

+0

私はアンドロイドプログラミングを嫌い、今まで見た中で最大のフリーキングな悪夢、すべてが畳み込まれていて、何百万ものバージョンがあります。 Androidのスタジオも大きな悪夢で、そんなにお金で会社は信じられないような製品を作ることができないと信じています! –

関連する問題