Note that there are some explanatory texts on larger screens.

plurals
  1. POcrash using ORMLite on Android with proguard
    text
    copied!<p>We're using ORMLite in our Android app. It's working fine, except when we try to do a build with proguard switched on.</p> <p>I've read various similar posts, and so far I've got in my proguard-project.txt</p> <pre><code>-keep class com.j256.** { *; } </code></pre> <p>as suggested in the following discussion <a href="http://sourceforge.net/p/proguard/discussion/182456/thread/6765bb69" rel="nofollow noreferrer">http://sourceforge.net/p/proguard/discussion/182456/thread/6765bb69</a> </p> <p>and I've got</p> <pre><code>-keepclassmembers class * { public &lt;init&gt;(android.content.Context); public &lt;init&gt;(android.app.Activity,int); } </code></pre> <p>as suggested in another stackoverflow question <a href="https://stackoverflow.com/questions/9853096/proguard-with-ormlite-on-android">Proguard with OrmLite on Android</a></p> <p>But it still not working. I <em>can</em> get it to run if I add </p> <pre><code>-dontobfuscate </code></pre> <p>but that somewhat missing the point of using proguard in the first place.</p> <p>When I run I get an</p> <pre><code>IllegalStateException: Could not find OpenHelperClass because none of the generic parameters of class class &lt;our.package.name&gt;.LaunchActivity extends OrmLiteSqliteOpenHelper. You should use getHelper(Context, Class) instead. </code></pre> <p>Where </p> <pre><code>public class LaunchActivity extends OrmLiteBaseActivity&lt;DatabaseHelper&gt; </code></pre> <p>and</p> <pre><code>public class DatabaseHelper extends OrmLiteSqliteOpenHelper </code></pre> <p>I've added</p> <pre><code>-keep public class * extends com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper -keep public class &lt;our.package.name&gt;.LaunchActivity </code></pre> <p>But still no luck. This question seems to have been asked before (<a href="https://stackoverflow.com/questions/12722852/problems-with-ormlite-and-proguard-obfuscation">Problems with OrmLite and proguard obfuscation</a>) but I'm hoping <em>somebody</em> will know what the solution is!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload