2017-09-21 3 views
0

クラッシュリックスプラグインをAndroid Studioプロジェクトにインストールしましたが、gradleタスクcrashlyticsUploadDistributionDebugはグラデーションタスクに追加されていません。 タスクをgradleに追加するにはどうしたらいいですか?クラッシュミックスタスクをグラデルタスクに追加できません

Crashlyticsのインストールは成功しましたが、以下のコマンドは失敗します。

$ ./gradlew assembleDebug crashlyticsUploadDistributionDebug 
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead. 

FAILURE: Build failed with an exception. 

* What went wrong: 
Task 'crashlyticsUploadDistributionDebug' not found in root project 'MyProject'. 

* Try: 
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

BUILD FAILED 

Total time: 1.02 secs 

私のbuild.gradleの設定は以下の通りです。

buildscript { 
    repositories { 
     mavenCentral() 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'io.fabric.tools:gradle:1.24.2' 
    } 
} 

apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 

android { 
    compileSdkVersion 26 
    buildToolsVersion '25.0.3' 

    defaultConfig { 
     applicationId "my.app.id" 
     manifestPlaceholders = [appName:"@string/app_name", iconLabel:"@string/icon_label"] 
     minSdkVersion 16 
     targetSdkVersion 26 
     versionCode 20 
     versionName "2.0.0" 
    } 

    buildTypes { 
     debug { 
      debuggable true 
      applicationIdSuffix ".debug" 
      versionNameSuffix '-dev' 
     } 
     release { 
      debuggable false 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    productFlavors { 
     develop { 
      manifestPlaceholders = [appName:"@string/dev_app_name", iconLabel:"@string/dev_icon_label"] 
      buildConfigField "boolean", "DEV_ENV", "true" 
      buildConfigField "String", "XXX", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
     } 
     staging { 
      manifestPlaceholders = [appName:"@string/stg_app_name", iconLabel:"@string/stg_icon_label"] 
      buildConfigField "boolean", "DEV_ENV", "true" 
      buildConfigField "String", "XXX", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
     } 
     production { 
      buildConfigField "boolean", "DEV_ENV", "false" 
      buildConfigField "String", "XXX", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:26.1.0' 
    compile 'com.android.support:recyclerview-v7:26.1.0' 
    compile 'com.google.code.gson:gson:2.7'       
    compile 'de.greenrobot:eventbus:2.4.0'        
    compile 'com.google.android.gms:play-services-analytics:11.0.4' 
    compile 'com.google.android.gms:play-services-gcm:11.0.4'   
    compile 'com.mcxiaoke.volley:library:1.0.16'      
    compile 'com.jpardogo.materialtabstrip:library:1.0.9'    
    compile 'com.lsjwzh:materialloadingprogressbar:0.5.5-RELEASE'  
    compile 'io.realm:realm-android:0.80.3'       
    compile 'com.github.ksoichiro:android-observablescrollview:1.5.2' 
    compile 'com.daimajia.swipelayout:library:[email protected]'    
    compile 'com.nineoldandroids:library:2.4.0'      
    compile 'com.daimajia.easing:library:[email protected]'     
    compile 'com.daimajia.androidanimations:library:[email protected]'   
    compile 'com.facebook.conceal:conceal:[email protected]'     
    compile 'com.appsflyer:af-android-sdk:[email protected]'     
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
} 

私は何が間違っているのか分かりません。

+0

このチュートリアルを参考にしてください。 https://www.numetriclabz.com/integrate-crashlytics-for-android-by-fabric-tutorial/ – Saneesh

+0

あなたのbuild.gradleを共有できますか? CrashlyticsとFabricがどのように設定されているかによって、何か目立つものがあるかどうかを確認したい。 – Alexizamerican

+0

@Saneesh Crashlyticsのインストールは成功しましたが、gradleタスクcrashlyticsUploadDistributionDebugはgradleタスクに追加されません。 – tama

答えて

1

私は、開発、ステージング、プロダクションをproductFlavorsに設定しているので、コマンドにproductFlavorを追加する必要があります。

以下は正しいコマンドです。 assembleDebug crashlyticsUploadDistribution [風味]デバッグ

例えば./gradlew

$ ./gradlew assembleDebug crashlyticsUploadDistributionDevelopDebug 
Incremental java compilation is an incubating feature. 
:app:preBuild UP-TO-DATE 
:app:preDevelopDebugBuild UP-TO-DATE 
:app:checkDevelopDebugManifest 
:app:preDevelopReleaseBuild UP-TO-DATE 
:app:preProductionDebugBuild UP-TO-DATE 
:app:preProductionReleaseBuild UP-TO-DATE 
:app:preStagingDebugBuild UP-TO-DATE 

・ 
・ 
・ 

:app:compileStagingDebugNdk UP-TO-DATE 
:app:compileStagingDebugSources 
:app:transformClassesWithDexForStagingDebug 
:app:mergeStagingDebugJniLibFolders 
:app:transformNativeLibsWithMergeJniLibsForStagingDebug 
:app:transformNativeLibsWithStripDebugSymbolForStagingDebug 
:app:processStagingDebugJavaRes UP-TO-DATE 
:app:transformResourcesWithMergeJavaResForStagingDebug 
:app:validateSigningStagingDebug 
:app:packageStagingDebug 
:app:assembleStagingDebug 
:app:assembleDebug 
:app:crashlyticsUploadDistributionDevelopDebug 
Uploading /my_android_project_path/app/build/outputs/apk/app-develop-debug.apk to Crashlytics... 

BUILD SUCCESSFUL 

Total time: 23.897 secs 
関連する問題