skrapeit / skrape-android-sample

2 stars 2 forks source link

Gradle build still fails #1

Closed TestDotCom closed 3 years ago

TestDotCom commented 3 years ago

Thanks for providing an android specific example, but as of now I still get errors while building my project - I've wrote the errors on this pastebin. Some more details:

If you need anything else just ask :)

faogustavo commented 3 years ago

@TestDotCom can you please run this command ./gradlew :app:dependencies > out_file in the project and post the output here?

TestDotCom commented 3 years ago

sure: here on pastebin

faogustavo commented 3 years ago

@TestDotCom if you remove the implementation from the skrape does it compile?

TestDotCom commented 3 years ago

I've tried to exclude the transitive dependency on kotlin-stdlib-jdk8 but it still doesn't compile. Also I can confirm this project builds correctly without skrapeit. Maybe you can point a specific commit to test?

faogustavo commented 3 years ago

@TestDotCom If you search in the log you send from the dependencies, you will see that there are more libraries depending on kotlin-stdlib-jdk8, so I don't believe it's the problem. I'm trying to find which may cause this, but the only thing that I found involves objenesis (which the project have from the androidx testing)

faogustavo commented 3 years ago

I'm suspecting that it's happening because of some class used by reflection.

faogustavo commented 3 years ago

@TestDotCom I've found the issue. The problem happens because of the WebSocket client (org.eclipse.jetty.websocket:websocket-client).

Try to import the project like this 👇 :

    implementation("it.skrape:skrapeit-core:1.0.0-alpha7") {
        exclude group: "org.eclipse.jetty.websocket"
    }
TestDotCom commented 3 years ago

Thank you very much! excluding jetty.websocket now the project compiles just fine. I've tested the app on the emulator and it seems fine.

Again thanks, I'll close this issue

christian-draeger commented 3 years ago

I just kicked the web sockets thing from core. (see commit https://github.com/skrapeit/skrape.it/commit/ee8a2c9ce79c25db2d1decbdb81cd287d608fcbb) the "browser fetcher" (that uses this transitive dependency) will be separated from core in the near future anyway. until then I think it is more important to be android compatible than supporting the scraping of data that comes over web sockets to webpages (I think its not that common use case for the majority of websites)

progress on the separation of the core can be tracked here https://github.com/skrapeit/skrape.it/issues/69

i have also release an 1.0.0-alpha8 version to maven central that includes this behaviour