When using the Crashlytics plugin in intellij I follow these steps.
Click plugin on toolbar.
Select App
Allow crashlytics to update AndroidManifest.xml as well has my first Activity.
Click "Next"
Try to build the App as the plugin instructs.
Then when i try to build i get this:
package com.crashlytics.android does not exist
I look in my dependencies and library and the jar is nowhere to be found.
What am I missing that would cause the library to not be loaded?
I solved this by following the maven instructions here https://crashlytics.com/downloads/maven and then just grabbing the jar from my .m2 and putting it in my libs folder. (This particular project was started as a maven project, then Maven was discarded and it has not yet been migrated to Gradle, so we're kind of in no-man's land). Anyway, I now have the jar.
The following configuration should work for Gradle-based projects:
buildscript {
repositories {
maven { url "http://download.crashlytics.com/maven" }
}
dependencies {
classpath "com.crashlytics.tools.gradle:crashlytics-gradle:1.+"
}
}
apply plugin: "crashlytics"
repositories {
maven { url "http://download.crashlytics.com/maven" }
}
dependencies {
compile "com.crashlytics.android:crashlytics:1.1.+"
}
Taken from https://crashlytics.com/downloads/gradle
After the automated setup from android studio, I was missing this line:
compile 'com.crashlytics.android:crashlytics:1.1.+'
Related
I had a GitHub project forked and some fixes applied to it. Now would like to use it as dependency in a project of mine. Have followed the instructions provided at jitpack.io but gradle build fails to find it.
build.gradle (all projects)
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
build.gradle (module)
dependencies {
implementation 'com.github.user:repo:e91058a'
}
Have tried calling File->Sync in Android Studio and running gradlew build --refresh-dependencies. Also tried defining dev-SNAPSHOT as the version number instead of commit hash. But it always ends up with Failed to resolve error.
What am I missing here?
Check your repositority on jitpack.io, and verify that the snapshot was actually built. (Enter your repo url, select 'branches', you must see a green icon near your commit sha)
Also if your repository is private, you'd need to add access token in build.gradle (you can find it in ur account setting)
I imported a project from my work-space. After this some errors were shown which I can't solve.
The message
Install Repository and sync project
was shown as a link, but clicking on it didn't solve my problem.
Add ConstraintLayout to your project.
To use ConstraintLayout in your project, proceed as follows:
Ensure you have the "maven.google.com" repository declared in your
module-level build.gradle file:
repositories {
maven {
url 'https://maven.google.com'
}
}
Add the library as a dependency in the same build.gradle file:
dependencies {
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
In the toolbar or sync notification, click Sync Project with Gradle Files.
The constraintLayout is not available yet on any stable relase of Android Studio. You have to download the latest Android Studio Preview to use it.
In my project, I'm trying to use the design support library. I have in my Gradle file:
dependencies {
....
compile 'com.android.support:design'
....
}
And when I try to build this, I get the error:
Normally I would just click Install Repository and sync project, however, this seems to not work anymore. Clicking this does absolutely nothing, even though clicking Open File works fine.
How can I manually install it?
I have the latest Android Support Repository (30.0.0), and Android Support Library (23.2.1) installed.
For me the solution was to add maven in the allprojects section. From the setup document: https://developer.android.com/topic/libraries/support-library/setup.html
in the project level settings.gradle file.
allprojects {
repositories {
jcenter()
maven{
url "https://maven.google.com"
}
}
}
Then double check the document for the latest version.
In the app level of the settings.gradle file add:
dependencies{
compile 'com.android.support:design:26.0.1'
}
And use Gradle to sync the project.
I think it is because you've not specified the version.
compile 'com.android.support:design:23.1.1'
change version to what you have downloaded.
You can go File->Settings->Gradle Look at the "Offline work" inbox,
If it's checked you can uncheck and try to sync again.
I forked a project and I made a little modification on https://github.com/oursgris/datetimepicker
How can I make it available in android studio ?
I tryied to add in build.gradle :
dependencies {
compile 'com.github.oursgris.datetimepicker:library:0.0.3'
}
I had an error : Failed to resolve: com.github.oursgris.datetimepicker:library:0.0.3
What did I missed ?
I manage to output aar file but I don't know how to make it available in android studio with a simple dependancy (like other projects)
Regards
You almost got it right. What was missing is that you need to add a repository that stores your 'aar' file. You can do this with JitPack:
repositories {
maven {
url "https://jitpack.io"
}
}
And then add your library as:
dependencies {
compile 'com.github.oursgris:datetimepicker:0.0.3'
}
I got a project from a client which I'm supposed to fix. The developer of the app just bailed out and now it's up to me to fix it.
Problem is, that he probably developed with eclipse, while I'm using AndroidStudio. So it wasn't build with gradle. But I managed to import the project and fix it so far, that I can sync gradle.
But he seemed to use an external library, this one: https://github.com/InQBarna/TableFixHeaders
I copied the content of the library folder into my project folder /libraries/tablefixheaders/.
I added include 'libraries:tablefixheaders' to my settings.grade and added compile project('libraries:tablefixheaders') to my dependencies in build.grade.
But if I want to rebuild the project now, I get Error:Configuration with name 'default' not found.. Does the external library have to have a build.gradle? If so, how does it look like? I tried several things but nothing worked for me.
Maybe it's a bit late :)
but I build a wrapper for InqBarna's library ready to use with gradle on this way:
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
dependencies {
compile "com.github.miguelbcr:TableFixHeaders-Wrapper:0.1.1"
}