Home » Android » Cannot run an Android app which is using Crashlytics with Maven build tool

Cannot run an Android app which is using Crashlytics with Maven build tool

Posted by: admin November 1, 2017 Leave a comment

Questions:

I added CrashLytics to my maven android project with the help of below document.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>myapp</artifactId>
<version>1.0.0</version>
<packaging>apk</packaging>

<name>MyApp</name>

<repositories>
    <repository>
        <id>fabric-repo</id>
        <url>https://maven.fabric.io/public</url>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>crashlytics-plugin-repo</id>
        <url>http://download.crashlytics.com/maven</url>
    </pluginRepository>
</pluginRepositories>

<dependencies>
    <!-- ... -->

    <!-- Crashlytics Kit -->
    <dependency>
        <groupId>com.crashlytics.sdk.android</groupId>
        <artifactId>crashlytics</artifactId>
        <version>2.6.8</version>
        <scope>compile</scope>
        <type>aar</type>
    </dependency>

</dependencies>

<build>
    <sourceDirectory>src</sourceDirectory>
    <finalName>${project.artifactId}</finalName>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.simpligility.maven.plugins</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <version>4.1.1</version>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </pluginManagement>
    <plugins>
        <plugin>
            <groupId>com.crashlytics</groupId>
            <artifactId>crashlytics-maven</artifactId>
            <version>1.12.0</version>
            <executions>
                <execution>
                    <id>GenerateResources</id>
                    <goals>
                        <goal>GenerateResources</goal>
                    </goals>
                </execution>
                <execution>
                    <id>CleanupResources</id>
                    <goals>
                        <goal>CleanupResources</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>com.simpligility.maven.plugins</groupId>
            <artifactId>android-maven-plugin</artifactId>
            <configuration>
                <sdk>
                    <platform>22</platform>
                </sdk>
            </configuration>
        </plugin>
    </plugins>
</build>

The thing is when I want to run the App it crashes at the beginning, and gives me the below error message:

 10-22 17:42:20.551 2957-2957/? E/CrashlyticsCore: .
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .     |  | 
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .     |  |
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .     |  |
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .   \ |  | /
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .    \    /
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .     \  /
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .      \/
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: 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.
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .      /\
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .     /  \
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .    /    \
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .   / |  | \
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .     |  |
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .     |  |
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .     |  |
10-22 17:42:20.552 2957-2957/? E/CrashlyticsCore: .
10-22 17:42:20.552 2957-2957/? W/System.err: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,

I’ve searched a lot, but all of the solutions are for gradle not for Maven. Could you please give me the way to solve this and explain why this is happening?

Answers: