Skip to content
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

Not creating tables in Android Studio 2.0 beta 6 #542

Closed
ed-george opened this issue Mar 10, 2016 · 22 comments
Closed

Not creating tables in Android Studio 2.0 beta 6 #542

ed-george opened this issue Mar 10, 2016 · 22 comments

Comments

@ed-george
Copy link

I noticed today that after upgrading from Android Studio 2.0 beta 4 to beta 6, that SugarRecord tables are not being created through fresh app install, database migration through version change, database migration through database name change and all other methods.

I believe this is to do with the 'Instant Run' feature as disabling this seems to resolve the issue.

I am not sure if there is anything that can be done by Sugar resolve this, but as it is likely to crop up in future, I believe it should be added to the README or associated documentation to warn others.

@JonatanSalas
Copy link
Collaborator

Yes, this problem is generated by InstantRun feature. We will work to improve compatibility with this Android Studio 2 feature.

@ed-george
Copy link
Author

Thanks for your response @jonisaa, is there any current work around that enables Instant Run to be enabled?

@JonatanSalas
Copy link
Collaborator

For the moment, I don't know a possible workaround to solve this trouble. Let me invest some time to find the root cause of the trouble and solve it.

I think the main problem is how InstantRun generate the .classes files and how It deploys to the running device.

@squeeish
Copy link

I migrated from ActiveAndroid because it wasn't creating tables too. Glad someone pointed it out!

@firaskafri
Copy link
Contributor

Any updates on this issue?

@jdochez
Copy link

jdochez commented Apr 1, 2016

The issue seems to be linked to this code :
https://github.com/satyan/sugar/blob/master/library/src/main/java/com/orm/util/MultiDexHelper.java

in InstantRun mode, we do not deliver the dex files in the main APK but inside an instant-run.zip file located in the root on the APK.

so the code above should be adapted to iterate over the content of the instant-run.zip (which will be a bunch of dex files) and getAllClassNames from it.

If you need more information, please contact jedo@google.com

@sibelius
Copy link
Contributor

sibelius commented Apr 1, 2016

@jdochez do you know how to fix this?

@firaskafri
Copy link
Contributor

@jdochez thank you so much, I will be contacting you soon for more information if needed

@sibeliusseraphini I am working on it, will be submitting a pull request soon

@sibelius
Copy link
Contributor

sibelius commented Apr 2, 2016

@firasalkafri that's great

@chandu4ugandhi
Copy link

@firasalkafri Is there any update for this problem.. I am facing the same issue for not creating the table like this:

android.database.sqlite.SQLiteException: no such table: FAVOURITE

@firaskafri
Copy link
Contributor

@chandu4ugandhi I have submitted a pull request #559 with the solution and waiting for the repository's maintainers to review and merge it @sibeliusseraphini

@chandu4ugandhi
Copy link

@firasalkafri then it would be new version for the sugar library? if yes then what it would be? let me know asap... my whole app stuck due to this bug. I am not able to work further currently.

@firaskafri
Copy link
Contributor

@chandu4ugandhi You either wait for the next release or use the library from source code including my changes.

@chandu4ugandhi
Copy link

@firasalkafri can you give me the link of your changed library so i can use as source code in my app.

@firaskafri
Copy link
Contributor

@ed-george
Copy link
Author

@chandu4ugandhi please see #536 - There is discussions around a temporary work around through disabling the Instant Run feature.

@firaskafri
Copy link
Contributor

@ed-george I'm talking about a solution, no need for work arounds.

@chandu4ugandhi
Copy link

@ed-george how to disable the instant run feature in android studio

@chandu4ugandhi
Copy link

@firasalkafri how to use the source code as library to my app that I downloaded from the url that you given.

@firaskafri
Copy link
Contributor

@chandu4ugandhi Simple, just read the documentation. And in your case I recommend using the stable release of Android Studio if you can't handle canary ones.

@chandu4ugandhi
Copy link

@firasalkafri there is a line about the eclipse.. no android studio help... give me the proper link where it can help me to import the source code as library.

@JonatanSalas
Copy link
Collaborator

This is solved in PR #564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants