Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Signed APK issue - no default constructor when there is one

Tags:

android

I'm getting the

'This class should provide a default constructor'

error when i'm trying to build the APK

this is my DBHelper class:

public class DBHelper extends SQLiteOpenHelper {

// create variables
public DBHelper(Context context)
{
    super(context, DATABASE_NAME , null, 1);
}
// onCreate

I was under the impression that

public DBHelper(Context context)

was the default constructor? And have checked other answers with this and can't find anything to help...

Thanks in advance

like image 260
ShWhite Avatar asked Nov 09 '22 14:11

ShWhite


1 Answers

A default constructor is a constructor without any arguments.

SQLiteOpenHelper needs at least a context so you won't be able to create a default constructor for your DBHelper. Are you sure this is the class causing this error ?

like image 191
nicopico Avatar answered Nov 15 '22 07:11

nicopico