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

"no such table" on SNAPSHOT and works fine on 1.5 #683

Open
xanscale opened this issue Oct 12, 2016 · 7 comments
Open

"no such table" on SNAPSHOT and works fine on 1.5 #683

xanscale opened this issue Oct 12, 2016 · 7 comments

Comments

@xanscale
Copy link

xanscale commented Oct 12, 2016

same code using sugar 1.5 works on all platform without problem.

using SNAPSHOT version on samsung s4 with android 5.0 i receive no such table but on other device works fine

classpath 'com.android.tools.build:gradle:2.2.0'

compile 'com.github.satyan:sugar:-SNAPSHOT'
compileSdkVersion 24
buildToolsVersion "24.0.3"
minSdkVersion 18
targetSdkVersion 24

public class App extends SugarApp {}

<application android:name=".common.App">
<meta-data android:name="DATABASE" android:value="@string/DATABASE"/>
<meta-data android:name="QUERY_LOG" android:value="false"/>

instantRun disabled

could be this commit ? 92301ea

@xanscale
Copy link
Author

i have a suggestion: the problems about instantRun, multidex and incompatibility wiith new gradles are caused by same piece of code:

the code to find model class to create TABLE

i suggest to REMOVE completely that code and make a init method that as model classed as paramethers like

public static void init(Context context, Class... models)

is not to much to ask to developer to specify all model classes

and this resolve all of that problem

@aviadmini
Copy link

Agree with the comment above. Would be great to have an explicit way to initialize Sugar. Without classes parsing etc.

Using both latest snapshot and 1.5 with properly set up proguard still throws this exception on about 5% of devices

@Anfet
Copy link

Anfet commented Oct 24, 2016

Sugar is scanning models inside your
<meta-data android:name="DOMAIN_PACKAGE_NAME" android:value="***" />

If your modes are not there you will get no table error.

@aviadmini
Copy link

@Anfet models are there. Proguard is configured properly. Works for 95% users, 5% get the crash

@xanscale
Copy link
Author

@Anfet same code and same configuration works with sugar 1.5 and not with snapshot. and only for few devices.

@RossinesP
Copy link
Contributor

@aviadmini I opened a merge request for that feature : #692

@gstorer
Copy link

gstorer commented Apr 5, 2017

@RossinesP Thanks, that's exactly what I was looking for. I've only got a few tables and it seems silly to have the whole app fall over just for the sake of some magic auto detection of the model that only saves a few lines.

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

5 participants