2017-11-19 21 views
-1

私のアプリケーションは開いたらすぐに停止し、「アプリケーションが停止しました」というメッセージが表示されます。これはgradle.buildコードです。ライブラリのバージョン間の互換性に関して私が間違いを犯したかどうかを知りたい。 ありがとうございます。Androidスタジオbuild.gragleライブラリの互換性

apply plugin: 'com.android.application' 
 

 
android { 
 
    compileSdkVersion 26 
 
    buildToolsVersion '26.0.2' 
 
    defaultConfig { 
 
     applicationId "example.com.avotreservice" 
 
     minSdkVersion 15 
 
     targetSdkVersion 26 
 
     versionCode 1 
 
     versionName "1.0" 
 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
 
    } 
 
    buildTypes { 
 
     release { 
 
      minifyEnabled false 
 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
 
     } 
 
    } 
 
} 
 

 
dependencies { 
 
    implementation fileTree(dir: 'libs', include: ['*.jar']) 
 
    implementation 'com.android.support:appcompat-v7:26.0.2' 
 
    implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
 
    testImplementation 'junit:junit:4.12' 
 
    androidTestImplementation 'com.android.support.test:runner:0.5' 
 
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2' 
 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
 

 
    testCompile 'junit:junit:4.12' 
 
    compile 'com.android.support:appcompat-v7:26.0.2' 
 
    compile 'com.android.support:design:26.0.2' 
 
    compile 'com.google.android.gms:play-services-wearable:9.4.0' 
 
    compile 'com.google.android.gms:play-services-maps:9.4.0' 
 
    compile 'com.google.firebase:firebase-core:9.4.0' 
 
    compile 'com.google.firebase:firebase-database:9.4.0' 
 
}

+1

エラーのスタックトレースを投稿してください。 Stacktraceは、Android Studioで表示されるクラッシュの簡単な説明です。 –

答えて

-1

通常のライブラリは、問題が発生することはありませんbuild.gradleに含ま..アプリケーションは通常、理由は(​​そのようMainActivity.java中にNullPointerExceptionなど)あなたのコードで実行時例外の発生したを停止しました。

あなたの問題がまだbuild.gradleにあると思うなら、使用しているライブラリをほとんど使用しているbuild.gradleの下に私が与えています。あなたはそれを試すことができます:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.3" 
    defaultConfig { 
     applicationId "my.package" 
     minSdkVersion 16 
     targetSdkVersion 21 
     versionName '1.0.7' 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     signingConfig signingConfigs.config 
     versionCode 7 
     vectorDrawables.useSupportLibrary = true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

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:25.3.1' 
    compile 'com.google.android.gms:play-services-maps:11.0.4' 
    compile 'com.google.android.gms:play-services-location:11.0.4' 
    compile 'com.google.firebase:firebase-core:11.0.4' 
    compile 'com.google.firebase:firebase-messaging:11.0.4' 
    compile 'com.google.firebase:firebase-crash:11.0.4' 
    compile 'com.google.firebase:firebase-database:11.0.4' 
    compile 'com.google.android.gms:play-services-ads:11.0.4' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support:support-v4:25.3.1' 
    compile 'com.android.support:support-vector-drawable:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    testCompile 'junit:junit:4.12' 
} 

apply plugin: 'com.google.gms.google-services' 
関連する問題