Closed glomowa closed 4 years ago
Hey :) Could you please provide more information?
Which version of skrape{it} are you using?
Related to your error message I guess you are using skrape{it} in context of Android app development, am i correct?
Could you please provide more specific information about the error? Like the full and exact error message or maybe even a stacktrace. What you want to archive and what you tried exactly can be helpful as well
Regarding DEX (dalvik executable format) and "back tick function names" (and with whitepaces in the name):
Android does not actually run Java class files, but uses a different kind of virtual machine (originally Dalvik) that uses the DEX format instead. As part of building your app it will take all your .class files and translates them into a single (or multiple for multidex) dex file. Without looking at the DEX spec it is clear that this format is more restrictive on symbol names (as in our case function names including space). So this is basically a DEX limitation.
Are you using skrape{it}'s matcher in backtick syntax somewhere in your code? (e.g.
`to be`
val scrapedData = skrape {
url = "xxxxx"
mode = Mode.DOM
extract {
htmlDocument {
img {
withClass = "img"
findAll {
attribute("src")
}
}
}
}
}
Log.d("Debug", scrapedData.toString())
that's my code.. i make a blank app and got that error while building the project the app not running yet, the error occured while building
Hi, I had this issue too, and the new snapshot seems to have fixed the initial `to be` error, but it's now occurring with `1xx Informational response`, in the HttpStatus enum. Not sure what the fix would be since JvmName doesn't work on enum names, but it would probably need to be for all the values of the enum (plus a JvmName for some functions below it in the file that don't have one).
This is occuring even without any actual code from the library in the app, so it's just having the Gradle dependency that is throwing the error. Here's the stacktrace for the error:
Hey thx for the stacktrace, since I don't have an sndroid example project that uses skrape{it} so far this helps a lot.
Same issue as with the to be
method (methods that have a space in the name), it's an issue that only happens on Android, on the jvm it's totally fine.
I will fix this and try to find a way to add compiling to DEX as part of the CI to avoid thing
S like that in the future :)
@andb3 are you still facing problems with DEX compiling on android when trying to add skrape{it}'s latest master as dependency? to add latest master as dependency you can use the jitpack-release as described here: https://github.com/skrapeit/skrape.it#using-bleeding-edge-features-before-official-release
⚠️ i added this issue to be part of milestone 1.0.0 because it is a blocker in terms of android compatibility. it has to be fixed before final 1.0.0 release
@christian-draeger all of the space issues have been fixed on the latest snapshot but now the apostrophe in the 418_I'm_a_teapot
code throws a similar error. I think that should be the last issue from looking at the source but not sure.
Damn :D ok I'll change it. To bad that as you mentioned @JvmName isn't applicable on enum values. Give me a second
@andb3 should be fixed now. Can you please retry? I don't have an android project to try currently.
@christian-draeger it's working with the latest snapshot, thanks!
Nice! Thx for helping.
Hi guys, i just trying this lib for scraping webpage, but i got an error when trying to deploy it on my device
"Space characters in SimpleName 'to be' are not allowed prior to DEX version 040"