1

I'm trying to build a react native module for the Kin Android SDK (https://kinecosystem.github.io/kin-ecosystem-sdk-docs/docs/android-guide.html#integrating-with-the-kin-sdk).

I'm struggling with how to arrange the dependencies. In traditional Android (and RN) projects there's a project build.gradle and an app build.gradle - when creating a module there's just one available, along with the two that the project which is going to be using the module has.

I'm asked to place this line in the project module's build.gradle:

maven {          
    url 'https://jitpack.io'      
}

and this line in the app module's build.gradle:

dependencies {      
    ...      
    implementation 'com.github.kinecosystem:kin-devplatform-android:0.0.12'  
}

But any combination of putting these lines in build.gradle files (in the module or the app itself) results in errors:

Execution failed for task ':react-native-kin:prepareReleaseDependencies'.
> Dependency Error

Any help would be amazing - it may be something obvious to a Java developer. I've also attached the stacktrace below:

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':react-native-kin:prepareReleaseDependencies'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.api.GradleException: Dependency Error. See console for details.
        at com.android.build.gradle.internal.tasks.PrepareDependenciesTask.prepare(PrepareDependenciesTask.java:87)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 14 more
4
  • Can you share fhe entire error output? Does building debug works? I managed to build debug in my environment on a simple react native project, will try release as well. Commented Aug 19, 2018 at 20:25
  • what build tools version / target SDK version / compile SDK version are you using? the error I recieve seems to vary depending on this, so maybe there's a specific one needed Commented Aug 20, 2018 at 3:09
  • i've written a report of how to quickly reproduce the error (starting from react-native init) here, along with the errors: pastebin.com/yP2XJ6W0 (if you could share a barebones working react-native project that would be amazing) Commented Aug 20, 2018 at 3:10
  • Yes, I can see from the error that build tools are probably the problem, I'll try to follow your steps Commented Aug 20, 2018 at 4:36

2 Answers 2

1

The default project created by React Native uses old versions of Android toolchain (build tool 23, android gradle plugin 2.2.3, and gradle 2), in order to compile kin-devplatform-android, newer toolchain version are needed, as this SDK depends on some newer android support libraries.

I uploaded a sample React Native project that compiles successfully with kin-devplatform-android:
https://github.com/kincommunity/rn-kindevplaform-sample

In this sample repo:
gradle wrapper updated to 4.1, android gradle tools updated to 3.0.0, google maven repository added here and here, compile sdk version bumped to 26 together with build tools, support library updated to 26, and kin-devplatform-android sdk was included.

Sign up to request clarification or add additional context in comments.

Comments

0

Version 0.0.12 is a bit "problematic" and has issues compiling using JitPack (it's a JitPack bug). In the newer version, 0.8.1, this issue should be resolved: com.github.kinecosystem:kin-devplatform-android:0.8.1

7 Comments

Thanks for the reply - I'm still getting the same issue, even with 0.8.1, just adding the import to a regular React Native android project
Please share your project & app build.gradle files
Thanks. android/build.gradle: pastebin.com/uGLYpWKK - android/app/build.gradle: pastebin.com/z59WSiaL (note that react-native-kin is imported, but this is an empty project atm so has no effect - errors only occur from the compile 'com.github.kinecosystem...' line. once I can get this working on a RN project on its own I'll look into moving it into the RN module.)
This warning also comes up a lot, though I don't know if it's significant: "Module 'com.github.kinecosystem:kin-devplatform-android:0.8.1' depends on one or more Android Libraries but is a jar"
Do you face any issues when you try adding the dependency to a regular Android studio project?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.