IllegalArgumentException: la valeur de liaison à l’index 1 est null

Est-ce que quelqu’un sait ce que cela signifie?

12-31 20:55:45.861: ERROR/AndroidRuntime(12478): Caused by: java.lang.IllegalArgumentException: the bind value at index 1 is null 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.database.sqlite.SQLiteProgram.bindSsortingng(SQLiteProgram.java:234) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.database.sqlite.SQLiteQuery.bindSsortingng(SQLiteQuery.java:182) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:48) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:280) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at net.lp.collectionista.providers.ProductContentProvider.query(ProductContentProvider.java:350) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.content.ContentProvider$Transport.query(ContentProvider.java:163) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.content.ContentResolver.query(ContentResolver.java:245) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at net.lp.collectionista.providers.FacadeContentProvider.query(FacadeContentProvider.java:563) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.content.ContentProvider$Transport.query(ContentProvider.java:163) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.content.ContentResolver.query(ContentResolver.java:245) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at net.lp.collectionista.util.ScanAddTask.existsProduct(ScanAddTask.java:164) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at net.lp.collectionista.util.ScanAddTask.(ScanAddTask.java:71) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at net.lp.collectionista.util.ItemScanAddTask.(ItemScanAddTask.java:34) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at net.lp.collectionista.ui.activities.collections.cd.CDCollectionViewWindow$MusicCDItemScanAddTask.(CDCollectionViewWindow.java:147) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at net.lp.collectionista.ui.activities.collections.cd.CDCollectionViewWindow.restoreLocalState(CDCollectionViewWindow.java:1044) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at net.lp.collectionista.ui.activities.collections.cd.CDCollectionViewWindow.onRestoreInstanceState(CDCollectionViewWindow.java:966) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.app.Activity.performRestoreInstanceState(Activity.java:815) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1096) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2641) 

The bind value fait apparemment référence à la selectionArgs pour la sélection, que vous insérez dans query() . Si une telle valeur selectionArgs est null , vous obtenez ceci.

@Gray réponse de @Gray et @pjv était le point pour se rendre compte de quel problème causait cette erreur. Vous devez faire attention à la sélection et aux selectionArgs correspondant, si vous passez selection = null et selectionArgs = something , vous obtiendrez aussi cette erreur! 🙂 Thnks!