I am trying to use SQLDelight 2.0.0-alpha02 but it...
# squarelibraries
l
I am trying to use SQLDelight 2.0.0-alpha02 but it seems like I'm missing something with the setup. Using the guide ( https://cashapp.github.io/sqldelight/android_sqlite/ ) but then replacing it with the new namespace
app.cash.sqldelight
and version
2.0.0-alpha02
gradle seems to be a bit unhappy. I'm using AS Dolphin Canary 9.
I used the Android Studio Compose app template and added in this
j
The driver should also use app.cash.sqldelight group
l
Good catch
j
And the snapshot version
You also need the snapshot maven repo added
a
alphas are on maven central, shouldn't need snapshot repo
l
i guess it's not the driver causing the failure
a
do you have an AndroidManifest.xml with a package name in the same repo?
you can get around this by setting the package name explicitly
Copy code
sqldelight {
  MyDatabase {
    pacakgeName = "..."
  }
}
its possible AGP 7.3.0 and sqld are incompatible, they change the manifest parsing APIs now and then
j
Oh right I'm using the snapshot blob sweat smile
e
@alec in 7.3.0 I think they started the process of deprecating the package from the manifest, and get it from the
namespace
in the gradle model
l
(1) AS Arctic Fox You might be right on the AGP thing, using arctic fox with gradle v7.0.x the gradle sync completes just fine. gradle 7.0.2 & gradle plugin 7.0.4 (2) AS Dolphin There is no package name in the AndroidManifest.xml. But the app specific build.gradle seems to have a android.namespace entry (new?). (gradle 7.4.2 & plugin 7.3.0-alpha09)
oh that explains it, thanks Eliezer
(3) Chipmunk Seems to work fine (gradle-bin 7.3.3 + gradle plugin 7.2.0)
a
well, i'll put up a fix anyways since seems like its going to get removed in 8.0 and we'll want to get ahead of that https://github.com/cashapp/sqldelight/pull/3220
l
Ah ok, I guess I'll try using chipmunk for now to try out sqldelight 2.x. To follow up on your suggestion Alec, if i add the
sqldelight { }
in the gradle file, it just gives me another error message unfortunately:
Copy code
Caused by: groovy.lang.MissingPropertyException: Could not set unknown property 'pacakgeName' for object of type app.cash.sqldelight.gradle.SqlDelightDatabase.
a
I misspelt
packageName
😄
l
And I didnt notice it 🤦
well this sparks joy, it worked! 🙏
449 Views