Tasker and appfactory permissions

1,125 views
Skip to first unread message

Niklas Häljesgård

unread,
Jan 3, 2018, 1:44:32 PM1/3/18
to Tasker
Hi,

I have made an app long ago and it has been working fine.
Now when I have made updates in the code it no longer works when I export it to an apk.
Seems that the calender-functions and gps do not work anymore..
And I did not change any of the functions that does not work.
What can I do to get this fixed?

//Niklas

Niklas Häljesgård

unread,
Jan 8, 2018, 7:17:31 AM1/8/18
to Tasker
I set the tasker pref to run in foreground and that made it!

Rich D

unread,
Jan 8, 2018, 7:20:32 AM1/8/18
to Tasker Google Groups Post
There is also a place in the app export tab to put in extra permissions if needed. 

Niklas Häljesgård

unread,
Jan 8, 2018, 7:24:14 AM1/8/18
to Tasker
Thanks!

Here´s another one!
Do you know how to get the permissions enabled for the app?
For a while ago I got questions from android when installing the app if i grant the permissions.
Now I don´t and have to set them manually.

Rich D

unread,
Jan 8, 2018, 7:53:52 AM1/8/18
to Tasker Google Groups Post


Here´s another one!
Do you know how to get the permissions enabled for the app?
For a while ago I got questions from android when installing the app if i grant the permissions.
Now I don´t and have to set them manually.

If you set them as a extra permission in the app export it should give message on install about permission and ask if you want to install.

However I have noticed that now in oreo,  it will "sometimes" install without asking but then when the app actually goes to use that feature you will get a pop up asking if you want to grant permission.

Have you tried running the complete app to see if it request permission?




Rich D

unread,
Jan 8, 2018, 8:20:59 AM1/8/18
to Tasker Google Groups Post
On second thought. If you are able to go to app settings and grant permission there, then I believe that means Tasker has already declared it requires this permission so adding as a extra on export might not work. 

Post back if adding it as a extra at export helps. 

Niklas Häljesgård

unread,
Jan 8, 2018, 10:32:32 AM1/8/18
to Tasker
I am able to grant permission in app settings.
I added them as extra in permissions and still no go.

Rich D

unread,
Jan 8, 2018, 10:47:20 AM1/8/18
to Tasker Google Groups Post
I set the tasker pref to run in foreground and that made it!

Could you clarify exactly what you mean here. 

What made it?

Niklas Häljesgård

unread,
Jan 8, 2018, 10:56:47 AM1/8/18
to Tasker
The gps would not start if "run in foreground" was set. Thats because Android Orea does not allow gps in background.
Before I set the "run in foreground" no gps symbol showed up.


Still the grant permission-function do not work, i have to set it manually.

Niklas Häljesgård

unread,
Jan 8, 2018, 10:58:57 AM1/8/18
to Tasker
Correction:
The gps would not start if "run in foreground" was NOT set.

Sean Williams

unread,
Jan 8, 2018, 11:07:28 AM1/8/18
to Tasker
Still the grant permission-function do not work, i have to set it manually.

What's the target sdk for your app?

Rich D

unread,
Jan 8, 2018, 11:13:55 AM1/8/18
to Tasker Google Groups Post
Forgot to ask if you had made sure Tasker "and" Tasker app Factory have been updated to the latest version?

Niklas Häljesgård

unread,
Jan 8, 2018, 11:30:37 AM1/8/18
to Tasker
The target is Oreo - 26.
I have latest version from Google Play.

Sean Williams

unread,
Jan 8, 2018, 11:54:26 AM1/8/18
to Tasker
The target is Oreo - 26.
I have latest version from Google Play.

Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app.

Niklas Häljesgård

unread,
Jan 8, 2018, 12:57:38 PM1/8/18
to Tasker
The app does not ask for permission.
It doesn't ask my to grant them.

Sean Williams

unread,
Jan 8, 2018, 1:38:22 PM1/8/18
to Tasker
The app does not ask for permission.
It doesn't ask my to grant them.

No.

If the device is running Android 5.1 or lower, or your app's target SDK is 22 or lower: If you list a dangerous permission in your manifest, the user has to grant the permission when they install the app; if they do not grant the permission, the system does not install the app at all.


If the device is running Android 6.0 or higher, and your app's target SDK is 23 or higher: The app has to list the permissions in the manifest, and it must request each dangerous permission it needs while the app is running. The user can grant or deny each permission, and the app can continue to run with limited capabilities even if the user denies a permission request.

Tasker targets a lower android version. Tasker itself does not request dangerous permissions because you accept them upon installation.

Tasker also does not automatically give kid apps the ability to request these permissions. However you could use Taskers java actions to check if the kid app has each permission and then request them from an activity.

Rich D

unread,
Jan 8, 2018, 1:58:30 PM1/8/18
to Tasker Google Groups Post
Hi Sean. 
Thanks for the great write-up. I knew it was something like that but never had all the specific details.

I think you might have misunderstood the Op's last post.

The way I understand it if he opens the apps information after the install the permissions are there and of course they have not been authorized yet. So it sounds like Tasker included the correct permissions on install, however when the app is first run the app will just fail and not ask for permission. However if he manually grants permission then the app will work as expected. 

Rich D

unread,
Jan 8, 2018, 2:01:11 PM1/8/18
to Tasker Google Groups Post
Hopefully the op can confirm or deny that is all correct
Message has been deleted

Niklas Häljesgård

unread,
Jan 8, 2018, 2:22:11 PM1/8/18
to Tasker
Den måndag 8 januari 2018 kl. 19:58:30 UTC+1 skrev Rich D:
> The way I understand it if he opens the apps information after the install the permissions are there and of course they have not been authorized yet. So it sounds like Tasker included the correct permissions on install, however when the app is first run the app will just fail and not ask for permission. However if he manually grants permission then the app will work as expected. 

Correct!

Rich D

unread,
Jan 8, 2018, 3:55:28 PM1/8/18
to Tasker Google Groups Post


Correct!

I get the same results on my device using the get location action. It looks as though pent will need to fix something with permissions for location. If he does not respond to this in a day or so I would post a new posting as a bug report with all the relevant data and a link to this post. 

In the meantime I think you could simply export the app with an SDK Target of 22





Niklas Häljesgård

unread,
Jan 8, 2018, 4:40:16 PM1/8/18
to Tasker
Ok, thanks I will try that!

Niklas Häljesgård

unread,
Jan 8, 2018, 4:41:40 PM1/8/18
to Tasker
Oh, I forgot, it's the same with calendar. No asking for permissions

Niklas Häljesgård

unread,
Jan 8, 2018, 5:05:23 PM1/8/18
to Tasker
When i try exporting the app for target 22. It crashes on start.

Rich D

unread,
Jan 8, 2018, 5:11:45 PM1/8/18
to Tasker Google Groups Post

When i try exporting the app for target 22. It crashes on start.

Did you change both the min android version and the target Android version to 22 ?



Niklas Häljesgård

unread,
Jan 8, 2018, 5:14:01 PM1/8/18
to Tasker
Yes l did.

Rich D

unread,
Jan 8, 2018, 5:18:41 PM1/8/18
to Tasker Google Groups Post
Perhaps you added some new actions that are not compatible with that version.

Rich D

unread,
Jan 8, 2018, 5:31:31 PM1/8/18
to Tasker Google Groups Post
Did you delete the old app?

Niklas Häljesgård

unread,
Jan 8, 2018, 5:44:34 PM1/8/18
to Tasker
Yes.

Rich D

unread,
Jan 8, 2018, 6:44:09 PM1/8/18
to Tasker Google Groups Post


My only guess would be you have added a action that is not supported in sdk 22. 

You will have to manually enable it until Pent can have a look. :(

Niklas Häljesgård

unread,
Jan 9, 2018, 11:04:08 AM1/9/18
to Tasker
Thank you for all of your help!

Serban Vasile

unread,
Jan 16, 2018, 12:27:07 AM1/16/18
to Tasker
I have similar issues...an app that is working fine in Tasker, when exported to apk, even though it lists the permissions before building the apk, doesn't write the permissions to the apk. The installed app works fine only after setting the permissions manually. Tried different versions of Android as target, minimum, maximum, but it didn't make a difference.
If anyone could build an apk successfully with the latest version of Tasker, please tell us your secret :)

Nenea Aglaia

unread,
Jan 31, 2018, 9:33:59 AM1/31/18
to Tasker
Found solution on stackoverflow, answer not related to tasker but Android...all the apk's made with Android target higher than 22 are not setting permissions anymore when installed, or at least when installing as an app outside of the app store (unknown sources)...there is a new way to handle permissions for newer Android versions which I didn't care to understand since setting target to version 22 (Android 5.1) resolved all my problems. The compiled app didn't experience any issues with speed or anything else that I notice when running on Android 7.1.1.
As a side note, when I looked at the apk manifest with the Advanced Permission Manager app from the app store, even the >22 apk versions looked fine, requiring all the permissions that I needed. That was the little detail that made me say that the issue could be outside of tasker, related to Android.

Hope it helps.

José Barbosa

unread,
Mar 11, 2018, 8:31:26 PM3/11/18
to Tasker
thank you Finally I was able to update Tasker. I was using 4.9 until today. I finally found the time to look for a solution. Many thanks guys. using Tasker 4.9 and App Factory I have created many tools that work well in Android 7.1 but  I Didn't  want to get stuck in 4.9
Reply all
Reply to author
Forward
0 new messages