Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

IllegalArgumentException thrown when forms and instances db not present. #303

Open
lakshyagupta21 opened this issue Aug 18, 2019 · 9 comments

Comments

@lakshyagupta21
Copy link
Contributor

Software and hardware versions

Android vx.x.x, device used...

Problem description

When you fresh download the ODK-Collect and Skunkworks-Crow app(Clear all storage directories of both the apps), and when transferring of forms happens receiver throws IllegalArgumentException.

Steps to reproduce the problem

  1. Fresh start the skunkworks-crow application (Clear both collect and skunkworks-crow storage dirs)
  2. Download any form in one device and fill it so that one filled form can also be sent.
  3. Open Skunkworks-crow app and now transfer filled forms from one device to another.
  4. Open receiver device and start receiving the forms, it crashes as soon as blank form is received.

Expected behavior

App should not crash.

Other information

It looks like whenever ODK-Collect app is fresh started both instances and forms db is not created due to which it crashes in skunkworks-crow because its not able to find the table to which it wants to write.

Crash log

2019-08-18 12:05:12.782 3341-3499/org.odk.share E/DownloadJob: java.lang.IllegalArgumentException: Unknown URL content://org.odk.collect.android.provider.odk.forms/forms
        at android.content.ContentResolver.insert(ContentResolver.java:1639)
        at org.odk.collect.android.dao.FormsDao.saveForm(FormsDao.java:205)
        at org.odk.share.tasks.DownloadJob.readForm(DownloadJob.java:334)
        at org.odk.share.tasks.DownloadJob.readFormAndInstances(DownloadJob.java:238)
        at org.odk.share.tasks.DownloadJob.receiveForms(DownloadJob.java:171)
        at org.odk.share.tasks.DownloadJob.setupDataStreamsAndReceive(DownloadJob.java:155)
        at org.odk.share.tasks.DownloadJob.initJob(DownloadJob.java:125)
        at org.odk.share.tasks.DownloadJob.onRunJob(DownloadJob.java:107)
        at com.evernote.android.job.Job.runJob(Job.java:132)
        at com.evernote.android.job.JobExecutor$JobCallable.runJob(JobExecutor.java:191)
        at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:176)
        at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:159)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
@huangyz0918
Copy link
Contributor

every time when I deleted the odk folder, and then open ODK Collect, Collect crashes, but the second time Collect works fine.

@alokbatham
Copy link

@opendatakit-bot claim

@getodk-bot
Copy link
Member

Hello @manit-alokbatham!

You have attempted to claim an issue without the labels "help wanted", "good first issue". It seems like you are new to Open Data Kit, so we suggest working on a good first issue issue first. After doing one quick win, then try a help wanted issue. We also recommend reading README.md and CONTRIBUTING.md before getting started.

To claim this issue anyway, comment on this issue again with the command @opendatakit-bot claim --force.

@alokbatham
Copy link

@opendatakit-bot claim --force

@getodk-bot
Copy link
Member

Welcome to Open Data Kit, @manit-alokbatham! We just sent you an invite to collaborate on this repository at https://github.com/opendatakit/skunkworks-crow/invitations. Please accept this invite in order to claim this issue and begin a fun and rewarding experience contributing to Open Data Kit!

Here are some tips to get you off to a good start:

  • Please read the README.md and CONTRIBUTING.md in this repo. Those two documents have much of what you need to get started.
  • Join the ODK developer Slack to get help, chat about this issue, and meet the other developers.
  • Sign up and introduce yourself on the ODK community forum to meet the broader ODK community.

See you on the other side (that is, the pull request side)!

@alokbatham
Copy link

alokbatham commented Nov 26, 2019

Hi @lakshyagupta21

I'm trying to reproduce this. But, I'm not able to transfer the form saved from one device to other over wi-fi/bluetooth in both cases there is time-out to connect/pair coming on screen in the end, even in the case of bluetooth, I checked that my device is available in the list, but at the time of pairing it fails and in the end time-out. (tried on master's .apk)
Tried 2 times. But this didn't work. This one is a blocker to check my changes.

Devices Used-
Receiver: Android 9, Samsung M20
Sender: Android 9, Samsung A10

Instructions for connection. Note: I installed fresh ODK in my both devices, and I installed skunkworks-crow.apk in the both devices using adb install command. Then i deleted all the paths/directories created with it's installation. And when i tried this for the second time. I deleted previous paths/directories first.

Note: Even issue has been fixed from my end, i need to check at my end first.

@ajay-prabhakar
Copy link
Contributor

Hi @lakshyagupta21

I'm trying to reproduce this. But, I'm not able to transfer the form saved from one device to other over wi-fi/bluetooth in both cases there is time-out to connect/pair coming on screen in the end ...

hello @manit-alokbatham Just make some things pair both devices initially and then start transforming or make the default transferring method as Bluetooth

@alokbatham
Copy link

Hi @lakshyagupta21
I'm trying to reproduce this. But, I'm not able to transfer the form saved from one device to other over wi-fi/bluetooth in both cases there is time-out to connect/pair coming on screen in the end ...

hello @manit-alokbatham Just make some things pair both devices initially and then start transforming or make the default transferring method as Bluetooth

Okay, I'll check this later.

@getodk-bot
Copy link
Member

getodk-bot commented Dec 9, 2019

Hello @manit-alokbatham, you have been unassigned from this issue because you have not updated this issue or any referenced pull requests for over 15 days.

You can reclaim this issue or claim any other issue by commenting @opendatakit-bot claim on that issue.

Thanks for your contributions, and hope to see you again soon!

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

No branches or pull requests

5 participants