1

I'm attempting to fork Microsoft's Adaptive Cards repository and include my fork in an Android project using jitpack.io. The challenge here is that the Android project is not in the root directory of the project; it lives under source/android. At least I think that's my problem.

Looking at the jitpack build log of my fork and new feature branch, I can see that it's finding the repo and branch, but the build fails with the following error messages:

Android project not found. Looking for AndroidManifest.xml and project.properties.
Build tool exit code: 0
Looking for artifacts...
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2
Looking for pom.xml in build directory and ~/.m2
2019-07-02T19:10:51.036415693Z
Exit code: 0

ERROR: No build artifacts found

Full build logs: https://jitpack.io/com/github/synchealth/AdaptiveCards/feature~custom-typeface-custom-typeface-gbd45cf5-1/build.log

It's pretty clear that jitpack is not finding the Android project in the relevant sub-directory.

Here's how I'm including the dependency via gradle:

implementation 'com.github.synchealth:AdaptiveCards:feature~custom-typeface-SNAPSHOT'

However, this gives me an error in Gradle: ERROR: Failed to resolve: com.github, which is odd.

To include the original repo, this is what I had:

implementation 'io.adaptivecards:adaptivecards-android:1.2.0'

Here, adaptivecards-android is the artifact id as specified in the generated pom.xml, but I'm not sure how to or if I should use this artifact id when attempting to resolve the package from github. I've tried also tried

implementation 'com.github.synchealth:AdaptiveCards:adaptivecards-android:feature~custom-typeface-SNAPSHOT'

But I get another ERROR: failed to resolve error in Gradle.

What is the proper way to fork this repository and inform jitpack of the sub-directory I am trying to build?

Patrick Goley
  • 5,397
  • 22
  • 42

1 Answers1

1

While the code is hosted on github the compiled library is most likely fetched from jcenter or google. If you look in your other build.gradle file you will see this:

repositories {
    jcenter()
    google()
}

Those are the places your project will look for its dependencies. Your simplest solution will be to compile your version of the library and add it locally to a lib folder. You can add this as a dependeny and add the jar file to a libs folder:

implementation fileTree(include: ['*.jar'], dir: 'libs')

or if it is compiled as an .aar (Android archive)

implementation fileTree(include: ['*.aar'], dir: 'libs')
Bakon Jarser
  • 703
  • 6
  • 20
  • Thanks for the help! This worked for me, but I actually ended up importing the .aar a module in my project using this guide here. https://developer.android.com/studio/projects/android-library – Patrick Goley Jul 03 '19 at 18:57