-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No such table error #50
Comments
Can you share your model class and the android manifest.. Must be a configuration issue. thanks, |
This is my manifest:
|
Hi @amaurymuro. I got the same thing, and like you I had included all 4 optional meta-data tags in my manifest. Removing them fixed it for me (and I don't mind having default db name). @satyan probably one of these that causes the issue? If it helps, my meta-data config was:
|
Happened to me too, but turn out that what was wrong was me not following the Getting Started doc. @satyan , maybe more verbose documentation is necessary here, i.e. in that description of VERSION metadata, just to keep people changing that default value of 2 to 1 initially. Thanks ! |
guys, |
@DidiPc if it's an option for you, try what I did - drop the meta-data tags. One of them is the cause. @awidarto's comment above makes it sound like the problem is the version metadata, so you could start with that. |
@DidiPc can you share your manifest and the entity class. Also, try removing the app from the device and running afresh. If, for some reason, there's an issue with creating table, it would throw this error while performing any db operations. |
Hi, I'm had the same problem and I'm resolved by implementing the empty constructor in my SugarRecord subclass. |
@ciotto Right. Just checked with my old code, and the only difference was the absence of empty constructor. It's fixed after adding that ! |
As of 1.2 build, we had a requirement of having a constructor with Context paramter. |
This issue has been resolved. Closing it. |
Just to complement anyone how fall on this page, im using Sugar ORM on version 1.3 ... had the same error, removing thie package tag DOMAIN_PACKAGE_NAME solved for me... im still using the other 3. |
I am also having a similar problem. If I don't have DOMAIN_PACKAGE_NAME, I get a NullPointerException on my main Activity, if I do have it declared I get the no table error. I have tried with and without the optional attributes but still get those errors. I also have the blank constructor in my model. |
@bbody how are you import the lib? Using gradle? |
I am using Gradle. I am exploring other libraries at the moment. |
@bbody since im not using gradle, cant say that could be a issue to that... don't think so but. |
I have followed all the aforementioned solutions to no avail. |
@bbody could you share yours package tags used on android manifest? And one of your classes that extend SugarRecord? |
@bbody i also tried everything suggested without success, in the end i deleted the applications cache and now it works |
I tried above solutions but failed |
I'm facing this problem too and the version used is 1.3. I managed to solved it by removing the Constructor of the model class completely, hope it helps someone with similar issue! |
where we need to use the constructor |
where we need to use the constructor?? |
this should really be fixed +1 |
Why is this library so buggy ? Satyan please write some more documentation in the website, in example you have created class without context and in another database creation method there you are passing context, please fix these little issues. BTW , it crashes in my device and also shows a white screen when app starts for 100- 200 ms. |
I was having the same issue i solved it by adding
|
Is it possible to Add new table in new version released without removing older version ?? |
Solved by changing the database name: |
do you have a drawable ic_launcher? |
I try at new TestProject. Exception : I use this tutoriall - https://android-arsenal.com/details/1/337 http://pastebin.com/iB1J1KRj - main activity |
|
First Thank you very much for help @sibeliusseraphini I fixed I use a 1.3, I had a mistake in the manifest meta-data android: name = "DOMAIN_PACKAGE_NAME" android: value = "com.example.user.wrongPackage.Model" - wrong PACKAGE Advice to other check if you have a well-configured manifest |
I just to have the same problem, I fixed by adding an empty contructor, and compile with the 1.3 Sugar orm version and rainstalled the app, and before new testing run cleanner in device and clear cache. meta-data android:name="DATABASE" android:value="MyDb.db" Models content a Sugar model classes for example => example extends SugarRecord |
For me this error occured because i had I don't know if this would help other but it certainly something that the devs should look into. Try adding the project as library project and try debugging the source code and you will find the same issue. |
i did this thing: |
Yes I was having the same issue, @miladna7 Thanks man your suggestion works. |
it is fixed on master and on 1.5 version |
Hi, no changment, i've got the same error.. |
@aubertdavy try to change the name of your database or update to the version 1.5 |
@Gujarats yes that's what i did !! |
Ok i solved my problem extending SugarApp and passing application context (and not base context) on create overriding method |
@aubertdavy, can you be more specific? |
@cdaringe |
public class MySugarApp extends Application { |
i'm sorry to be a total rookie on this (i rarely code java), but no where in my current app do I use thanks for the tip. |
nm, @aubertdavy, i did figure out how to do that. still gives the error, though, unforunately
|
try, reinstall the app in the phone, in some cases its necesary, I never use application context to initialize sugar context in my apps |
Same problem, fixed using gradle 1.5.0 (before was 2.0.0-beta7) |
Instant Run now works #564 |
i have the same problem, but i fixed by:
public class SugarORMApplication extends Application {
|
This is not working with GRADLE 2.0.0!!!!!!! |
@felipebonezi please check #564 |
yes, disable instant Run in android studio |
I tried to disable instant run on android studio 2.1.2 but still have no luck. classpath 'com.android.tools.build:gradle:1.5.0' on project's build.gradle. I hope the patch will be released soon. |
This may help : |
updating build.gradle to 'com.github.satyan:sugar:1.5' fixed it for me |
Not working with kotlin using 'com.github.satyan:sugar:1.5' |
I have a problem java.lang.NullPointerException: SugarContext has not been initialized properly. Call SugarContext.init(Context) in your Application.onCreate() method and SugarContext.terminate() in your Application.onTerminate() method. |
Hi, I am new with Sugar. I have a simple android project with a single record named "Abonado". I have followed the wiki' steps but when I ran the project and I had the error: "android.database.sqlite.SQLiteException: no such table: ABONADO (code 1): , while compiling: SELECT * FROM ABONADO". Then I looked the db file created and it’s true, the table ABONADO does not exit.
Then I looked the master project SugarActivity and it does not make the tables either and I also had another similar error: "android.database.sqlite.SQLiteException: no such table: TEXT_NOTE (code 1): , while compiling: DELETE FROM TEXT_NOTE".
Have you experienced this issue before?Could you please help me? Thanks in advanced. Respectfully.
ohh I am using android 4.2
The text was updated successfully, but these errors were encountered: