How do I add Crashlytics to AIDE? - android

I use AIDE while on the go. On Android Studio I added Crashlytics to my project but upon moving it over to AIDE,it doesn't seem to recognize Crashlytics. Specifically, this line is specified as an unknown dependant according to compile error:
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true}
Is there anything I can do to fix this or is AIDE incapable of supporting Crashlytics?

Ensure you have the plugin preinstalled in Android Studio - https://fabric.io/downloads
Then in your build.gradle, add/update the following at the very top:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// Fabric
classpath 'io.fabric.tools:gradle:+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
If AIDE does not work properly, then please download the AAR library, then copy it in your /libs folder (say the name of the file is fabric-2.5.2.aar
Update build.gradle as follow:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// Fabric
classpath 'io.fabric.tools:gradle:+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
// .aar repositories
repositories {
flatDir { dirs 'libs' }
}
dependencies {
compile(name: 'fabric-2.5.2', ext: 'aar')
...
}

Related

Cross module dependencies with Gradle and mavenLocal

My project is an old android application (module-front) with modules (module-shared) that used to be published on maven.
I have an access to source code of the module and I want to store my module in my mavenLocal.
My directory structure :
/project
/module-front
build.gradle
/module-shared
build.gradle
build.gradle
My module-front gradle file has a dependency on the published (but removed) module-shared :
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
// Android properties here
}
dependencies {
ext {/* Versions here */}
compile group: 'module-shared group', name: 'module-shared name', version: moduleSharedVersion
// compile and testCompile here
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
apt {
// apt here
}
ModuleSharedVersion is defined in my root gradle file :
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
allprojects {
ext {
moduleSharedVersion= '2.1'
}
version = '1.4.8h'
group = 'myGroup'
}
Problem starts here:
Now I want my module-shared to be stored in mavenLocal so my module-front might access it :
apply plugin: 'application'
apply plugin: 'maven'
version = '2.1'
uploadArchives {
repositories {
mavenInstaller {
repository(url: mavenLocal().url)
pom.groupId = 'module-shared group'
pom.artifactId = 'module-shared name'
pom.version = version
}
}
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
This is my attempt to store it in mavenLocal inspired from multiple posts (example) which doesn't work...
I don't know much about gradle, not enough to fix it tbh.
Please tell me if you need any other file that might be important to understand/answer.
Thanks :)

Do you add multiple buildscripts in `app/build.gradle` for manual Android linking in React Native?

In the section adding the gradle plugin for this React Native component, it tells me to add the following code to app/build.gradle:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
However, I've added other components that said to add similar code. For example, this component says to add this code:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// The Fabric Gradle plugin uses an open ended version to react
// quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
What I Want To Know:
How do you add the code for both of these components into the same project?
You should have one build script and add all the repositories in the repositories block and the dependences in the dependencies block
it should be like this
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99]'
// The Fabric Gradle plugin uses an open ended version to react
// quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.+'
}
}
for the apply plugins should be in the build.gradle for the app module
add them on the top
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "your.app.package"
}
}

com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'

Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'.
Possible causes for this unexpected error include:Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
In Android studio 3.0 on this problem, use the JakeWharton great god butterknife. Please how to deal with this problem, this is no problem on the Android studio 2.3. May be I used the wrong way, please advise, is originally used 8.5.1 version, an error, I upgraded to 8.6.0, found that the problem cannot be solved.
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://jitpack.io"
}
maven {
url 'https://maven.google.com'
}
maven {
url 'https://dl.google.com/dl/android/maven2/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1+'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.6.0'
classpath ("com.tencent.mm:AndResGuard-gradle-plugin:1.2.3") { changing=true }
classpath 'com.letv.sarrsdesktop:BlockCanaryExPlugin:0.9.8.3'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url "https://jitpack.io"
}
maven {
url 'http://www.idescout.com/maven/repo/'
}
maven {
url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories"
}
maven {
url 'https://maven.google.com'
}
maven {
url 'https://dl.google.com/dl/android/maven2/'
}
}
}
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
task printProps << {
println commandLineProjectProp
println gradlePropertiesProp
println systemProjectProp
println envProjectProp
println System.properties['system']
}
apply plugin: 'com.android.application'
//butterknife
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'com.jakewharton.butterknife'
/**
* library
*/
dependencies {
compile 'com.jakewharton:butterknife:8.6.0+'
apt 'com.jakewharton:butterknife-compiler:8.6.0+'
}
Downgrade butterknife-gradle-plugin to 8.4 or use 9.0 snapshot.
Kotlin 1.2.10
Gradle 3.0.1
Build tools version 27.0.3
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'com.jakewharton.butterknife'
In my library project this comment helped me (R2 imports):
https://github.com/JakeWharton/butterknife/issues/963#issuecomment-342547601
project's build.gradle:
buildscript {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
google()
jcenter()
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
}
}
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
module's build.gradle:
apply plugin: 'com.jakewharton.butterknife'
...
dependencies {
compile 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
kapt 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'
}
This way you can use the
apply plugin: 'com.jakewharton.butterknife'
Just remove
classpath 'me.tatarka:gradle-retrolambda:3.7.0'
downgrade butterknifeversion to 8.4.0
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
Don't forget to remove below line
apply plugin: 'me.tatarka.retrolambda'

Appdynamics implementation

I'm trying to add Appdynamics into my application, I'm doing those steps: https://docs.appdynamics.com/display/PRO40/Instrument+an+Android+Application#InstrumentanAndroidApplication-ToaddtheAppDynamicsAndroidagentrepositorytoyourproject but after all I have error:
Error:(15, 13) Failed to resolve: com.appdynamics:appdynamics-runtime:1.0
This is how my build.gradle (for all project) looks like:
buildscript {
configurations.classpath.resolutionStrategy.force('com.android.tools.build:gradle:1.2.3')
repositories {
maven { url uri("adeum-maven-repo") }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3', 'com.appdynamics:appdynamics-gradle-plugin:2.0'
}
}
allprojects {
repositories {
mavenCentral()
}
}
and build.gradle (from app module):
apply plugin: 'adeum'
repositories {
flatDir {
dirs 'lib'
}
maven {
url uri('adeum-maven-repo')
}
}
dependencies {
compile 'com.appdynamics:appdynamics-runtime:1.0'
and adeum-maven-repo paste into project. Any idea what am I doing wrong?
That error means that gradle is unable to resolve the dependency on com.appdynamics:appdynamics-runtime. The easiest way to fix this problem is to use the AppDynamics libraries from maven central rather than the adeum-maven-repo directory. You can do that by editing your top level gradle file to look like this:
buildscript {
configurations.classpath.resolutionStrategy.force('com.android.tools.build:gradle:1.2.3')
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.appdynamics:appdynamics-gradle-plugin:4.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
Then your project-level gradle file would look like:
apply plugin: 'adeum'
repositories {
flatDir {
dirs 'lib'
}
}
dependencies {
compile 'com.appdynamics:appdynamics-runtime:4.+'
}
Note that I have removed the references to adeum-maven-repo, and changed the version numbers on the AppDynamics artifacts to refer to them as they exist in maven central. Once you've done this, you no longer need adeum-maven-repo in your project, since gradle is now downloading these dependencies automatically.

Android Studio Compile Issue with plugin

Folks,
I am trying to use
com.github.ksoichiro:android-observablescrollview:1.5.1
and I had several problems which prompted me to add:
apply plugin: 'com.android.application'
repositories {
mavenCentral()
}
to my Project's build.gradle file, now when I try to sync my project I get the following message:
Error:Cause: java.io.FileNotFoundException: D:\Backup 2015\Development\AndroidStudioProjects\IKAG\src\main\AndroidManifest.xml (The system cannot find the path specified)
This is my whole build.gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply plugin: 'com.android.application'
//
repositories {
mavenCentral()
}
android {
compileSdkVersion 20
buildToolsVersion '21.1.2'
}
dependencies {
// Other dependencies are omitted
compile 'com.github.ksoichiro:android-observablescrollview:1.5.1'
}
allprojects {
repositories {
jcenter()
}
}

Categories

Resources