使用IntelliJ中的Crashlytics运行Android App
作者:互联网
我正在尝试使用Maven将Crashlytics集成到我们的Android项目中.
当从命令行mvn clean package时,我已经设置了所有必需的插件,并执行并完成了构建.
当运行从命令行构建的应用程序时-一切正常.
从IntelliJ运行应用程序时出现问题.
我认为所有Crashlytics魔术都在执行generate-resources阶段时发生:
<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中:
<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时如何执行此目标?
应用程序运行时出现错误:
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时崩溃.
解决方法:
我能够使用它的方法是进入右侧的Maven Projects选项卡,选择Plugins,选择crashlytics,然后在GenerateResources目标上单击鼠标右键,然后选择“ Execute Before Make”
标签:maven,crashlytics,intellij-idea,android 来源: https://codeday.me/bug/20191123/2064653.html