Cordova Crosswalk file selection no app can perform this action error

743 views Asked by At

I am creating an android app using Cordova with the Crosswalk webview and the dtworkshop-inappcrossbrowser plugin. The app is effectively wrapping a website.

On the website there is a form that allows you to upload a photo. The problem is that when I select the browse button I get the message "Choose an action" followed by "No apps can perform this action".

I am not totally sure how the upload button functions, but I know that it is not an input element because I experimented with an input and I know it works.

I read that it could be a permissions so I have added the following, but still no luck:

READ_EXTERNAL_STORAGE, INTERNET, WRITE_EXTERNAL_STORAGE, ACCESS_NETWORK_STATE, ACCESS_WIFI_STATE, CAMERA, MANAGE_DOCUMENTS.

I have tested in the android chrome browser and everything works, so I know its related to the app.

I have created the same app for iOS and everything works. I know there are issues with the android webview hence the reason I am using the crosswalk plugin, thought these issues were going to be solved.

Any help advice about how I can get this working is much appreciated.

2

There are 2 answers

1
eagle On

Hey I have found that editing the accept="" attribute to accept="image/" or accept="video/" fixed the problem. Also attribute such as .ext or more than one attribute i.e accept="image/, video/" though syntax wise are correct will throw the same error. Hope this helps

0
SamVerschueren On

I had the same problem and it was due to the fact I was not including cordova.js as script in my index.html file.

So I simply added the following line to index.html and it was working fine.

<script type="text/javascript" src="cordova.js"></script>