web3j / sample-project-gradle

Sample web3j project using Gradle
268 stars 151 forks source link

Issues and solutions I've taken #16

Open NetkoNefarious opened 5 years ago

NetkoNefarious commented 5 years ago

Foreword: many issues can be fixed by applying certain steps from the Getting Started guide.

  1. No Greeter.java (wrapper code) Solution:

    • Download Solicity compiler (check the .sol file for version, currently 0.4.25 is needed for the file) and web3j cli.
    • Follow this guide to generate the Java code you need
  2. Cannot resolve 'ethLogFlowable' Solution: add into build.gradle

    • compile ('org.web3j:core:4.1.0') (Java 8)
    • compile ('org.web3j:core:4.1.0-android') (Android)
  3. RxJava dependency missing Solution: add into build.gradle

    • implementation "io.reactivex.rxjava2:rxjava:2.x.y" With x and y replaced by the version number found here.
JoaquimLey commented 5 years ago

This seems like a good candidate for a PR :)

iikirilov commented 5 years ago
  1. The web3j-gradle-plugin will generate the smart-contract wrapper for you when you build the project

  2. and 3. look like separate issues.

NetkoNefarious commented 5 years ago
The web3j-gradle-plugin will generate the smart-contract wrapper for you when you build the project

I didn't know this, I thought you needed the CLI to generate them.

iikirilov commented 5 years ago

@NetkoNefarious the plugin is relatively new.

Regarding 2. and 3. they should not be issues in a fresh clone on master branch. I believe these are issues unique to your environment.

I see you are developing on android. This sample project is not designed to be an android starter application so some changes are required.