Installing Android SQLite Asset Helper -
i need use ready made database. search solution on internet did not work until decided use mentioned library found here. however, found hard use library in installation procedures shallow beginners.
i appreciate step step procedure on how use android studio. in struggle tried copying sources main/libs , adding line gradle did not work. use api 19 if helps.
update here build.gradle
// top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:0.11.+' compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+' // note: not place application dependencies here; belong // in individual module build.gradle files } } allprojects { repositories { mavencentral() } }
trying compile project error error:(9, 0) no signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.defaultdependencyhandler.compile() applicable argument types: (java.lang.string) values: [com.readystatesoftware.sqliteasset:sqliteassethelper:+] possible solutions: module(java.lang.object)
this old question, doesn't seem have proper answer, , found while trying install sqliteassethelper
myself, thought should share experience, according instructions found here.
like inexperienced android studio users, i thought should download zip
github repository , place somewhere in pc. turns out this not way install sqliteassethelper, if using gradle
build system integrated in android studio.
what need described in github repository setup section. here step-by-step guide, additional information:
1) make sure gradle
not in offline mode
. (in android studio which @ version 2.2.2, go file > settings > build, execution, development > gradle
, uncheck offline work
in case checked. (this required first sync)
2) in android studio project navigator (on left) should see item entitled gradle scripts
. expand it, , should find build.gradle
file. if see 2 such files, there should comment in parenthesis next each 1 saying project: yourprojectname
, module: app
.
if open 1 saying project: yourprojectname
should see following comments:
// note: not place application dependencies here; belong // in individual module build.gradle files
so, should choose 1 saying module: app
, @ end of should see this:
dependencies { compile filetree(dir: 'libs', include: ['*.jar']) ... }
at point, should add code pointed out in github, this:
dependencies { compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+' compile filetree(dir: 'libs', include: ['*.jar']) ... }
that's all. start using it, have extend sqliteassethelper
class, pretty extending sqliteopenhelper
.
Comments
Post a Comment