Gradle/Android Studio setup error
Ben
Posted on
Mar 21 2015
Hello,
I'm trying to add Raygun to my Android app and i'm following the "Gradle/Android Studio" setup instructions. I've added the mentioned lines in my Graddle file and when i sync the project with the gradle file i get the following error: Error:(11, 13) Failed to resolve: com.mindscapehq.android:raygun4android:1.6.0
What am i missing?
Thanks
Callum
Posted on
Mar 23 2015
Our mistake with the version number there, the correct lines under dependencies { } are:
compile 'com.mindscapehq.android:raygun4android:1.3.0'
compile 'com.mindscapehq.android:raygun4android:1.3.0:sources'
Ben
Posted on
Mar 24 2015
Hi Callum,
I've added the corrected version but received the following error: Error:Dependency com.mindscapehq.android:raygun4android:1.3.0 on project application resolves to an APK archive which is not supported as a compilation dependency. File: C:\Users\
I've removed
- compile 'com.mindscapehq.android:raygun4android:1.3.0'
and left only
- compile 'com.mindscapehq.android:raygun4android:1.3.0:sources'
The app builds fine and sends the errors to Raygun.
Callum
Posted on
Mar 24 2015
Great to hear you got it working and thanks for the feedback - we'll update the documentation to reflect your experience.
johnmurphy01
Posted on
Dec 30 2015
I'm having problems getting Raygun integrated into my Android project and I'm having the same problems as Ben.
Error:Dependency com.mindscapehq.android:raygun4android:1.3.0 on project application resolves to an APK archive which is not supported as a compilation dependency.
I have: Android Studio for Mac version 1.5.1 Attempting to use Raygun for Android version 1.3.0 Android Plugin version 1.5.0 Gradle version 2.8 SDK version 23
Any help would be greatly appreciated. Thanks!
John-Daniel Trask
Raygun
Posted on
Dec 31 2015
Hi John,
I found the docs in one place were a bit out of date, but you'll want to follow the guide here: https://github.com/MindscapeHQ/raygun4android
I ran through a quick test myself, and found that I got the error above if I put the content suggested for the build.gradle file all into the project file (it needs to be split between the project one for the repository reference, and the module one for the compile call).
You'll also want to be using 2.0.0 of raygun4android, and 2.1 for gson.
I hope that helps, and sorry about the docs being a tad out of date in places, will look to get that tightened up shortly.
Kind regards,
John-Daniel Trask
johnmurphy01
Posted on
Jan 01 2016
Thanks! I no longer have errors when compiling. However, I wanted to test that I'm getting exceptions, so I added a manual exception on my Launch activity:
try {
throw new Exception("testing raygun");
}
catch(Exception ex)
{
e.printStackTrace();
}
I do not receive any logs for this exception. Am I missing something? I have setup RaygunClient.Init and AttachExceptionHandler as specified by the instructions.
RaygunClient.Init(getApplicationContext());
RaygunClient.AttachExceptionHandler();
John-Daniel Trask
Raygun
Posted on
Jan 01 2016
Hi John,
Could you tell me where you're throwing the test error, and where you're initing?
One thing: Your test error will be getting caught and handled by your try/catch block meaning Raygun won't pick it up since you're dealing with it happily. Try just throwing an unhandled error, or calling RaygunClient.Send(e) inside the catch block.
I hope that helps!
John-Daniel Trask
johnmurphy01
Posted on
Jan 05 2016
Everything is working fine now. It was because I was dealing with the exception. I got some real exceptions and they went through with no problems into Raygun.