与Crashlytics来自的IntelliJ运行Android应用程序 [英] Running Android App with Crashlytics from IntelliJ

查看:133
本文介绍了与Crashlytics来自的IntelliJ运行Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想Crashlytics融入我们使用Maven的Andr​​oid项目。 我都需要的插件设置,并建立执行,并通过命令行完成时 MVN清洁套装。 当运行应用程序的命令行建 - 这一切都OK

I'm trying to integrate Crashlytics into our Android project with Maven. I have all required plugins set up and build executes and completes when mvn clean package from command line. When running app built from command line - it's all OK.

问题发生。

我认为当执行产生-资源相均 Crashlytics 奇迹发生了:

I think all Crashlytics magic happens when generate-resources phase is executed:

<plugin>
    <groupId>com.crashlytics</groupId>
    <artifactId>crashlytics-maven</artifactId>
    <version>1.0.3</version>
    <executions>
        <execution>
            <id>GenerateResources</id>
                <goals>
                    <goal>GenerateResources</goal>
                </goals>
        </execution>
        <execution>
            <id>CleanupResources</id>
            <goals>
                <goal>CleanupResources</goal>
            </goals>
        </execution>
    </executions>
</plugin>

该插件添加到我的应用程序的pom.xml:

This plugin is added to my application pom.xml:

<build>
    <sourceDirectory>src</sourceDirectory>

    <plugins>
        <plugin>
            <groupId>com.crashlytics</groupId>
            <artifactId>crashlytics-maven</artifactId>
            <!-- full configuration declared in parent pom.xml -->
        </plugin>
        ... other plugins...
    <plugins>
</build>

所以 - 问题是 - ?我怎么执行这个目标时的IntelliJ建立我的APK

So - question is - how do I execute this goal when IntelliJ builds my APK?

我的错误时得到应用程序运行时:

Error I get when application runs:

ERROR/AndroidRuntime(11626): FATAL EXCEPTION: main
        java.lang.RuntimeException: Unable to create application lt.my.app.MyApplication: com.crashlytics.android.CrashlyticsMissingDependencyException: Crashlytics did not find a required runtime dependency. To configure your build environment, visit: http://www.crashlytics.com/api/v1/.../android/confirm/lt.my.app
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5085)
        at android.app.ActivityThread.access$1300(ActivityThread.java:162)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1436)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:158)
        at android.app.ActivityThread.main(ActivityThread.java:5777)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
        at dalvik.system.NativeStart.main(Native Method)
        Caused by: com.crashlytics.android.CrashlyticsMissingDependencyException: Crashlytics did not find a required runtime dependency. To configure your build environment, visit: http://www.crashlytics.com/api/v1/.../android/confirm/lt.my.app
        at com.crashlytics.android.j.a(SourceFile:37)
        at com.crashlytics.android.Crashlytics.a(SourceFile:770)
        at com.crashlytics.android.Crashlytics.start(SourceFile:157)
        at com.crashlytics.android.Crashlytics.start(SourceFile:135)
        at lt.my.app.MyApplication.onCreate(MyApplication.java:32)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5082)

更新(07-24):

接受的答案应该工作,但是如果你重新下载并重新安装插件 - 它应该与当地的IntelliJ建设者。虽然(今天)Ubuntu的机器上启动的IntelliJ时崩溃。

Update (07-24):

Accepted answer should work, but if you re-download and re-install plugin - it should work with native IntelliJ builder. Although (today) it crashes when launching IntelliJ on Ubuntu machine.

推荐答案

就是我能得到它的工作是通过进入右侧的Maven项目选项卡,选择插件,选择crashlytics并在GenerateResources目标单击鼠标右键,选择执行make之前

The way I was able to get it to work was by going into the Maven Projects tab on the right side, select Plugins, select crashlytics and on the GenerateResources goal right-click and select "Execute Before Make"

这篇关于与Crashlytics来自的IntelliJ运行Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆