Basic Gradle setup not working
paultuckey opened this issue · 3 comments
Hi,
Following up from a support ticket, I cannot get Raygun to build in any gradle and Android Studio based project. Perhaps someone out there can help.
/Users/paul/sc/android-raygun-integration-test/app/src/main/java/rgtest1/android/showcase/myapplication/FullscreenActivity.java:13: error: package main.java.com.mindscapehq.android.raygun4android does not exist
import main.java.com.mindscapehq.android.raygun4android.RaygunClient;
^
/Users/paul/sc/android-raygun-integration-test/app/src/main/java/rgtest1/android/showcase/myapplication/FullscreenActivity.java:14: error: package main.java.com.mindscapehq.android.raygun4android.messages does not exist
import main.java.com.mindscapehq.android.raygun4android.messages.RaygunUserInfo;
^
/Users/paul/sc/android-raygun-integration-test/app/src/main/java/rgtest1/android/showcase/myapplication/FullscreenActivity.java:60: error: cannot find symbol
RaygunClient.Init(getApplicationContext());
^
symbol: variable RaygunClient
location: class FullscreenActivity
/Users/paul/sc/android-raygun-integration-test/app/src/main/java/rgtest1/android/showcase/myapplication/FullscreenActivity.java:61: error: cannot find symbol
RaygunClient.AttachExceptionHandler();
^
symbol: variable RaygunClient
location: class FullscreenActivity
4 errors
:app:compileDebugJava FAILED
FAILURE: Build failed with an exception.
I've made a repo with full source to demonstrate that the setup is as per documentation:
https://github.com/ShowcaseSoftwareLtd/android-raygun-integration-test
I've had another look at this, and it looks like there are bugs or dependency conflict issues between certain versions for Gradle and the Android Tools Gradle Plugin. This is noted in that the repro pulls down the main\java\com\mindscapehq\android\raygun4android package beneath the raygun4android-1.3.0-sources folder in External Libraries, however the root cause appears to be that it can't find or compile the classes in the messages package (e.g RaygunUserInfo).
Note that these classes compile normally with Maven (such as from IntelliJ).
This is occurring with com.android.tools.build:gradle:1.2.3 as specified in the repro alongside Gradle 2.4 and Android Studio 0.9.9.
The reason this is concerning is there is a lot of documentation for the Android Tools Gradle Plugin stating there have been bugs and breaking changes in their releases - noted at http://tools.android.com/tech-docs/new-build-system/version-compatibility and http://tools.android.com/knownissues.
They also are working on a new 'Experimental' plugin which supports only Gradle 2.5 at this time. Essentially we can't support built systems which are buggy or constantly breaking, however we do know that at one point these was a combination of the build tools which built and referenced this Maven project correctly. Hopefully once the Gradle Plugin project stabilizes we can offer specific guidance, but in the meantime try altering the version numbers to find a compatible set as listed in the first link above.
Regards,
Callum Gavin
Mindscape Limited
Gidday,
I've got the build to work with the following combination:
Android Studio 1.3
Gradle 2.3
com.android.tools.build:gradle:1.2.3
Thanks for you assistance.
Great to hear! I'll make sure to add documentation for this to help others in future. Hope Raygun continues to be useful for yourself.
Regards,
Callum Gavin
Raygun Limited