I tried to integrate Firebase Crash reporter in my project.Here is a my gradle source.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.google.guava:guava:18.0'
classpath 'com.google.firebase:firebase-plugins:1.0.5'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "io.realm:realm-gradle-plugin:3.1.2"
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
apply plugin: 'com.google.firebase.firebase-crash'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "**********"
minSdkVersion 16
targetSdkVersion 26
versionCode 24
versionName "1.0.24"
testInstrumentationRunner "android.support.buy_tickets_verification_view.runner.AndroidJUnitRunner"
renderscriptSupportModeEnabled true
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.koushikdutta.urlimageviewhelper:urlimageviewhelper:1.0.4'
compile 'com.google.code.gson:gson:2.3'
compile('com.android.support:cardview-v7:26.1.0') {
force = true;
}
compile('com.android.support:recyclerview-v7:26.1.0') {
force = true;
}
compile('com.android.support:appcompat-v7:26.1.0') {
force = true;
}
compile('com.android.support:support-v4:26.1.0') {
force = true;
}
compile('com.android.support:design:26.1.0') {
force = true;
}
compile('com.android.support:support-vector-drawable:26.1.0') {
force = true;
}
compile 'com.wdullaer:materialdatetimepicker:3.1.3'
compile files('libs/junit-4.12.jar')
compile 'com.daimajia.swipelayout:library:1.2.0#aar'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'me.neavo:volley:2014.12.09'
compile 'com.android.support:multidex:1.0.1'
}
apply plugin: 'com.google.gms.google-services'
Here is a source.
I don't know why,but first time when I integrated Firebase crash log,it's worked perfect,but now,I can's see my errors in dashboard.
It's a strange situation,I don't know what's a wrong in my source
What am i doing wrong?
Thanks everyone
Related
I have Crashlytics working in my App.
I've added an Android Module to my App named 'engine-module' which has it's own Gradle dependencies.
I don't know how to import the Crashlytics dependency correctly and I just get the following error:
Error:(31, 13) Failed to resolve:
com.crashlytics.sdk.android:crashlytics:2.6.5
What I want to achieve is being able to access 'Crashlytics' from a Class within the 'engine-module' for example:
Crashlytics.setUserName("temp user name");
Is this possible? If so, how can it be achieved?
Project: build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
apply from: '../jacoco.gradle'
}
App/build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'com.neenbedankt.android-apt'
/**
* Default values for configuration options
*/
def suffixDefault = ""
def versionCodeDefault = 1
def versionNameDefault = "developerBuilt"
/**
* Android-specific configuration
*/
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.flowmellow.projectx
minSdkVersion 16
targetSdkVersion 25
versionCode project.getProperties().get('versionCode') ? project.getProperties().get('versionCode').toInteger() : versionCodeDefault
versionName project.getProperties().get('versionName') ? project.getProperties().get('versionName') : versionNameDefault
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
// Configurable options
applicationIdSuffix project.getProperties().get('appIdSuffix', suffixDefault) + ".debug"
// Common options
testCoverageEnabled true
}
release {
// Configurable options
applicationIdSuffix project.getProperties().get('appIdSuffix', suffixDefault)
// Common options
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
/**
* Dependencies
*/
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
//Dependency injection
apt 'com.google.dagger:dagger-compiler:2.7'
compile 'com.google.dagger:dagger:2.7'
provided 'javax.annotation:jsr250-api:1.0'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.1'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.robolectric:robolectric:3.1.2'
testCompile 'org.hamcrest:hamcrest-library:1.1'
compile 'com.android.support.constraint:constraint-layout:+'
compile('com.crashlytics.sdk.android:crashlytics:2.6.5#aar') {
transitive = true;
}
compile project(path: ':engine-module')
}
Module: engine-module/build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
minSdkVersion 16
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'])
compile 'com.android.support:support-annotations:25.0.0'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.robolectric:robolectric:3.1.2'
compile 'com.crashlytics.sdk.android:crashlytics:2.6.5'
}
SOLVED:
Project: build.gradle
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'io.fabric.tools:gradle:1.+'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
apply from: '../jacoco.gradle'
}
Module: engine-module/build.gradle
apply plugin: 'com.android.library'
apply plugin: 'io.fabric'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
minSdkVersion 16
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'])
compile 'com.android.support:support-annotations:25.0.0'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.robolectric:robolectric:3.1.2'
compile('com.crashlytics.sdk.android:crashlytics:2.6.5#aar') {
transitive = true;
}
}
You did not define any repositories for the engine-module module, this means it cannot resolve the associated dependencies.
Generally people define repositories for their entire project by adding the following code to the root build.gradle
subprojects {
repositories {
// Add repositories here
}
}
This makes these repositories available for all subprojects.
I am following some instructions, and I get this error.
Error:Could not find com.google.gms:google-services:3.0.0. Searched in the following locations: file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/gms/google-services/3.0.0/google-services-3.0.0.jar https://maven.fabric.io/public/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom https://maven.fabric.io/public/com/google/gms/google-services/3.0.0/google-services-3.0.0.jar
Required by panic_android:app:unspecified
My gradle is:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
classpath 'io.fabric.tools:gradle:1.+'
}
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.netvariant.panic"
minSdkVersion 15
multiDexEnabled true
targetSdkVersion 21
versionCode 2
versionName "1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile('com.twitter.sdk.android:twitter:1.13.1#aar') {
transitive = true;
}
compile 'com.skyfishjy.ripplebackground:library:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.android.support:multidex:1.0.1'
}
You seem to be missing jCenter()
repositories {
jCenter()
maven { url 'https://maven.fabric.io/public' }
}
I have been trying for hours now to enable data binding in Android. Here is my gradle:
buildscript {
repositories {
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
classpath 'com.google.code.ksoap2-android:ksoap2-android:3.1.1'
classpath "com.android.databinding:dataBinder:1.0-rc0"
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
android {
compileSdkVersion 16
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "ts.kiosk.app.checkout"
minSdkVersion 16
targetSdkVersion 16
versionCode 2
versionName "0.0.2.258"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
sourceSets {
main {
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
}
}
sourceSets {
androidTest.setRoot('src/test')
}
dataBinding {
enabled = true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:20.0.0'
compile 'com.crashlytics.android:crashlytics:1.+'
compile 'net.danlew:android.joda:2.7.2'
compile 'com.google.code.ksoap2-android:ksoap2-android:3.1.1'
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile project(':asterixmodule')
compile project(':servicemodule')
compile project(':sdfclient')
// Robolectric
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.apache.maven:maven-ant-tasks:2.1.3' // fixes issue on linux/mac
testCompile 'org.robolectric:robolectric:3.0'
}
I keep getting the error:
Error:Could not find com.android.databindig:databinder:1.0.-rc1 .
I have also read similar posts on SO stating that you also have to add:
classpath 'com.android.tools.build:gradle:1.3.0-beta1'
but my gradle is 2.4 so I'm thinking I don't need that and of course if I do add that statement, gradle cannot find that version of gradle (1.3.0)
I upgraded to version 2.0 of Android Studio and the gradle build issue went away
remove
classpath "com.android.databinding:dataBinder:1.0-rc0"
Starting with android gradle plugin 1.5.0, all you need is
android {
dataBinding.enabled = true
}
check your gradle version, i resolved it by upgrading :
previously :
classpath "com.android.tools.build:gradle:1.3.0"
I updated to :
classpath "com.android.tools.build:gradle:2.2.0"
Or 1.5.0 and newer.
GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
this is my project gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'maven-publish'
apply plugin: "java"
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha5'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
classifier "sources"
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar
pom.withXml {
asNode().appendNode('description', 'A demonstration of Maven POM customization')
}
}
}
}
this is my app.gardle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
generatedDensities = []
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/universal-image-loader-1.9.5.jar')
compile project(':databaseAutoCompleteLibrary')
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:gridlayout-v7:23.2.0'
compile project(':MPChartLib')
compile project(':filechooserlibrary')
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:support-v13:23.2.0'
compile 'com.android.support:appcompat-v7:23.2.0'
compile project(':Volley')
compile 'com.google.code.gson:gson:2.4'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.baoyz.swipemenulistview:library:1.3.0'
compile 'milyn:opencsv:1.6'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.android.support:multidex:1.0.1'
}
Apply this in your app build.gradle file
apply plugin: 'com.google.gms.google-services'
dependencies {
compile 'com.google.android.gms:play-services:8.3.0'
}
In your project build.gradle define
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.google.gms:google-services:1.5.0-beta2'
}
}
allprojects {
repositories {
jcenter()
}
}
Don't working this library from GitHub in Android Studio
My build.gradle(:project):
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.mymaterialdialogs"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile('com.afollestad.material-dialogs:core:0.8.4.2#aar') {
transitive = true
}
}
And My build.gradle(:app):
buildscript {
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Show this Error:
Error:(26, 13) Failed to resolve:
com.afollestad.material-dialogs:core:0.8.4.2 Show in
File(openFile:.../app/build.gradle)Show in Project Structure
dialog(open.dependency.in.project.structure)
Do the following steps:
1.In your build.gradle(:project) Add the following before dependencies
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile('com.afollestad.material-dialogs:core:0.8.4.2#aar') {
transitive = true
}
}
2.In your build.gradle(:app): replace
maven { url "https://jitpack.io" } with jcenter()
3.Sync project
Hope this helps.