android.permission.access_NETWORK_STATE

Hello from France on November 12, 2021,

I have made a program that works well, but I am in the process of improving it for my personal needs.
The day before yesterday the download after each modification worked fine, as well as the installation on my smartphone.
When the program started, everything was working fine too.

Since this morning the download is still working fine, as well as the installation on my smartphone.
But when I turn it on I have this message, which I didn't have before:
"Runtime Error
ConnectivityService: Netheir user 10246 nor curent process has android.permission.access_NETWORK_STATE "

Fortunately I am using a copy of my original program.
What happens, I also tried to use a copy of the original program WITHOUT any changes, the message is the same, so I can't use my program.

Can you help me please, it looks like it may be from Mit App Inventor, there may be a problem?

I don't know English, so this text is translated by Google translate, sorry ...

It seems this (normal) permission

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

is no longer declared in the Manifest since the → nb188 release (on Nov 11).
That needs to be fixed. @ewpatton @jis

https://developer.android.com/training/basics/network-ops/connecting

Summary

2 Likes

To work around the problem until the bugfix has been made, declare this permission yourself (manually) in the manifest.

See here:

1 Like

What are you doing in your app that it requires this permission? We had removed this permission from compiled apps because we believed that it was only really necessary for the companion to work (so we could obtain the IP address for establishing the live testing connection) and we do not believe that any other component in base App Inventor needs this permission. If you're using an extension in your app that talks to the connectivity service, the extension author will need to add the permission to their extension.

What is the advantage / benefit that this (standard) permission has now been removed?
It is / was (in my opinion) completely harmless and had no disadvantages.

Since there are a number of extensions that can check an Internet connection, the question remains whether the developers have declared this permission in the extensions, as they could assume that this permission is (was) always declared by default at AI2 and in all AI distros.

2 Likes

It was done based on this post here:

If removing this permission by default from compiled apps resolves the issue of most App Inventor apps being marked as trojans, then it is worth people having to update their extensions if they need to. Every major release of App Inventor would then end up with a bunch of posts that App Inventor has been "hacked," which is not the case.

Importantly:

  1. As of Sept 2019, only 2% of App Inventor projects made use of extensions. It follows that fewer than those use extensions to check network connectivity.
  2. The companion still includes the permission because it needs to check the network state when establishing peering with the web session, so any extensions will continue to work while live testing until the author updates the extension.
4 Likes

Ok, thanks for the explanations.

Hello ewpatton and Anke

Thank you for your intervention, and that reassures me at least as regards my programming, because obviously I was questioning myself ...
My program must order an arduino (esp8266-01 web server) with its own WiFi SSID, in access point mode 192.168.4.1
This web server, when it is connected to the sector obviously in 5 volts, and started by my program, puts in contact 5 volts a small arduino ESP32-CAM camera with another SSID in access point 192.168.4.1
It works very well using the "TaifunWiFi" extension, but of course programmers (beginners like me) often want to improve their programs, this is my case, hi, hi ...
It is a coincidence that this deletion is taking place now, fortunately my program is in a phase of improvement because it works, but it is especially important not that I recompile this program, at the risk of blocking everything, it would be a shame .. .
No doubt I must take into account a sentence which nevertheless recommends wisdom:
"The best is the enemy of good"

But as I would still like to go a little further in my use, I will see the side of Anke's proposal that I also thank of course, but I admit not knowing the use of "APK Studio Editor" which I hope I can bypass this authorization, the given link will probably help me, but I will have to understand all this, gggrrrrrrrrr

I simplified it for you.

Here is a small extension that declares this permission again in the Manifest.

Manifest

1 Like

First of all thank you very much, but I'm really sorry, where do I put your extention?

In my program?
I added it in my program, I attach a screenshot ...

But how do I use it?

I am really a beginner and really lost, I do not even know what the "Manifesto" is, nor how and if I should use it ...

1 Like

1 Like

In the Designer: Simply drag the extension onto the screen.
You don't need to use any block. Just build the APK.

Yes I did but I didn't refresh my browser ...
BINGO! it works perfectly.
BRAVO, and really a big THANK YOU

I will be able to continue to improve ... my poor knowledge ...
Thanks again it's really nice

I will put your extension in all my programs that use "TaiFunWiFi"

THANK YOU

I now added the permission android.permission.ACCESS_NETWORK_STATE into the wifi extension
you can download the latest version from the download section here https://puravidaapps.com/wifi.php

Taifun

2 Likes

Hello and thank you Taifun

Ok it's noted, it's nice to have added it to your WiFi extension, it will be very useful.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.