Crashlytics Error:(11, 0) Plugin with id 'io.fabric' not found compile lib - crashlytics

I am getting the error,
Error:(11, 0) Plugin with id 'io.fabric' not found
when trying to run crashlytics on my project.

I faced the same issue, when tried to use Fabric plugin for android studio(automated code generation by plugin).I followed this documentation also.
And finally, I could see there were some missed lines in build.gradle.
So this is the top level project build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'java'
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}
and this is the build.gradle for app module
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "your application package name"
minSdkVersion 10
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.google.code.gson:gson:2.3'
compile 'com.android.support:support-v4:22.0.0'
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:1.9.5"
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true;
}
}
and at last "clean build" and all was set for me.

I ended up creating an empty project and using the plugin on it and then I compared the gradle file and realized that this was not being added
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}

in your project gradle file:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'java'
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}
in your app gradle file:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "your application package name"
minSdkVersion 10
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.google.code.gson:gson:2.3'
compile 'com.android.support:support-v4:22.0.0'
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:1.9.5"
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true;
}
}

You just forget to add below mentioned line in Project level gradle file.
maven { url 'https://maven.fabric.io/public' }
Also please add below mentioned line in dependencies (in project level gradle file)
classpath 'io.fabric.tools:gradle:1.26.1'

I think you lost "google()" in repositories of buildscript.
buildscript {
repositories {
jcenter()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'io.fabric.tools:gradle:1.+'
}
}
allprojects {
repositories {
jcenter()
}
}

I have faced this issue while working with Android + Cordova + Angularjs Hybrid project.
apply plugin: 'io.fabric'
By commenting this line at the path /app/build.gradle solved the issue.
Hope it helps someone!!

Related

React-native latest changes/code is not being reflected in the build after running assembleRelase command

I am facing the problem with my release apk which is not updated with my latest code(If i made any changes in code, that reflects locally but not reflecting in release apk). I am using ./gradlew assembleRelease.
I have tried several solutions as
Release APK Not Updating With JavaScript Code
I have shared my build.gradle file for reference.
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 19
compileSdkVersion = 29
targetSdkVersion = 29
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.1")
classpath 'com.google.gms:google-services:4.3.4'
}
}
allprojects {
repositories {
mavenLocal()
maven {
url("$rootDir/../node_modules/react-native/android")
}
maven {
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {
url 'https://maven.cashfree.com/release'
}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}

Could not find method dependenciesInfo() for arguments Android

App Build Android Studio Error
Could not find method dependenciesInfo() for arguments
[build_7pycm2rxdjt52mhv3k1evqwie$_run_closure1$_closure9#1e56c29c] on
object of type
com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
Open File
Bulid failed
this is my build.gradle (App level)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.xxx.xxx.xxx"
minSdkVersion 17
targetSdkVersion 29
versionCode 3011
versionName "1.2.02"
vectorDrawables.useSupportLibrary = true
resConfigs "en"
multiDexEnabled true
}
aaptOptions {
cruncherEnabled false
}
dataBinding {
enabled = true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
debuggable false
jniDebuggable false
renderscriptDebuggable false
pseudoLocalesEnabled false
zipAlignEnabled true
}
debug {
debuggable true
jniDebuggable true
renderscriptDebuggable true
minifyEnabled false
zipAlignEnabled false
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dependenciesInfo {
// Disables dependency metadata when building APKs.
includeInApk = false
// Disables dependency metadata when building Android App Bundles.
includeInBundle = false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//Android X dependencies
implementation 'androidx.appcompat:appcompat:1.2.0-beta01'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
//Android Architecture Components
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
//Firebase dependencies
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.3'
//com.google dependencies
implementation 'com.google.android.gms:play-services-ads-lite:16.0.0'
implementation "com.google.android.material:material:1.1.0"
//other library gradle
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.android.volley:volley:1.1.1'
kapt 'androidx.room:room-compiler:2.2.5'
implementation 'androidx.room:room-runtime:2.2.5'
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'
}
apply plugin: 'com.google.gms.google-services'
My build.gradle (Project level) is as below:
buildscript {
ext.kotlin_version = '1.3.40'
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.26.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please suggest how to solve this issue.
I am using Android Studio 4.0.
I have tried restarting the Android Studio with "Invalidate cache" option but did not help.
dependenciesInfo DSL block appears only in 4.0 Gradle plugin version. You use 3.5.2
classpath 'com.android.tools.build:gradle:3.5.2'
Update it to 4.0

A problem occurred configuring project ':app'

Getting error when trying react-native run-android.I don't know why I'm getting this error.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
> A problem occurred configuring project ':react-native-vector-icons'.
> Could not resolve all dependencies for configuration ':react-native-vector-icons:classpath'.
> Could not find any matches for com.android.tools.build:gradle:2.3.+ as no versions of com.android.tools.build:gradle are available.
android\build.gradle is as follows.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is
installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
gradle version: 3.3,
plugin:2.2.3
Upgrade react-native-vector-icons: "^6.0.2" in package.json
Then run npm i react-native-vector-icons
As a last step, cd android && ./gradlew clean.
Change dependencies from:
dependencies {
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
}
to:
dependencies {
compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
}
also change buildscript dependencies to use: classpath 'com.android.tools.build:gradle:2.2.3'
and maven { url "https://dl.bintray.com/android/android-tools/" } instead of google()
So your ../node_modules/react-native-vector-icons/android/build.gradle should look like this:
buildscript {
repositories {
maven { url "https://dl.bintray.com/android/android-tools/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
apply plugin: 'com.android.library'
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet('compileSdkVersion', 26)
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 26)
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
}
repositories {
mavenCentral()
}
dependencies {
compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
}

Fabric / Crashlytics : gradle needs to run twice

I am working on an app, and when building it using gradle in command line ("clean build" or even "clean installRelease"), I am facing the issue where Crashlytics fails to start :
java.lang.RuntimeException: Unable to create application XXXXXXXX: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: com.crashlytics.android.core.CrashlyticsMissingDependencyException:
This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
install an Android build tool and ask a team member to invite you to this app's organization.
After trying many things presented on SO, I found out that if I ran :
./gradlew clean installRelease
./gradlew installRelease
my application starts without any issue.
It's a bit of a pain, as I have to build the app twice before publishing it (and if I ever forget to do it, I am publishing an unusable app :/
My gradle file is set up correctly (at least, the plugin does not complain about it), and gradle is up to date (gradle 2.9, android plugin 1.5.0, crashlytics 2.5.4, ...)
Here are a few lines from my build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.20.1'
classpath 'me.tatarka:gradle-retrolambda:3.2.3'
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
}
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.jakewharton.hugo'
apply plugin: 'io.fabric'
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
signingConfigs {
std {
}
}
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "XXXXXXXXXXX"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.std
}
debug {
signingConfig signingConfigs.std
}
}
productFlavors {
stubbed {
buildConfigField "boolean", "STUBBED", "true"
}
real {
buildConfigField "boolean", "STUBBED", "false"
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
dataBinding {
enabled = true
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile('com.crashlytics.sdk.android:crashlytics:2.5.4#aar') {
transitive = true;
}
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.jakewharton:butterknife:7.0.1'
}
If anyone has ever faced and fixed this kind of problem, I'd love to hear about it :)
Thanks !

Gradle Failed to resolve: commons-io:commons-io:+

When syncing Android project with gradle in android studio , it fails resolving
the packages shown in the screeshot below .
here's my 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' }
}
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.dmbteam.cityguide"
minSdkVersion 10
targetSdkVersion 22
versionCode 4
versionName '4.0'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.3.0'
compile 'commons-io:commons-io:+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:cardview-v7:+'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile('org.simpleframework:simple-xml:2.7.+') {
exclude module: 'stax'
exclude module: 'stax-api'
exclude module: 'xpp3'
exclude group: 'org.apache.commons', module: 'commons-io'
}
compile project(':pinterest_lib')
compile('com.crashlytics.sdk.android:crashlytics:2.4.0#aar') {
transitive = true;
}
compile 'com.google.android.gms:play-services-maps:7+'
compile 'com.google.android.gms:play-services-location:7+'
compile 'com.google.android.gms:play-services:7+'
}
under repositories, I usually find that I end up having to have a chain something like this:
repositories {
mavenLocal()
maven { url 'https://maven.fabric.io/public' }
jcenter()
}
In other words, it 1st tries to use your local maven repo, then the specific maven repo/mirror, and then falls back to jcenter as a last resort.