Coder Social home page Coder Social logo

Comments (9)

Chadori avatar Chadori commented on June 1, 2024 1

Hi again,

Yes, I can confirm it has that permission.
It seems I can reproduce if I run it on Pixel 3A - API29 but not on Pixel 3A - API 28 even after changing the target-sdk to 29.
image

Can you confirm? Thanks.

from cordova-plugin-network-information.

breautek avatar breautek commented on June 1, 2024 1

Nope, I still do not experience a device crash on a Pixel 3A, using a simple test app that alerts on network change (which it fires once on launch).

Previously I tested on an existing emulator I had, which was based on Pixel 2, but I'm pretty sure these are just skins and don't actually change the behaviour of the app (other than screen resolutions and some other technical details like total memory)

It's weird that you see the permission tag inside AndroidManifest.xml but having an error that suggest your app doesn't have that permission.

The next thing I'd confirm is if your apk actually has those permissions listed. You can check this by using the aapt tool:

aapt d permissions <path/to/apk>

You may need to add the android build tools to your path in order to use aapt. The executable should be located at: $ANDROID_HOME/build-tools/29.0.2/

Note that your build tools version may vary.

The expected output of the aapt command above should be something like:

$ aapt d permissions app-debug.apk 
package: com.bt.network
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'

If ACCESS_NETWORK_STATE is missing, then there is something happening between writing the AndroidManifest.xml and actually building the apk. Or the AndroidManifest.xml is improper. If this is the case, we'd need to see if we can build a sample reproduction app that includes the minimal amount of configuration necessary to reproduce the problem. Since I haven't been able to reproduce it myself, it seems likely there might be another plugin causing a conflict.

Here's a list of others things you can try:

  • Reinstalling the the plugin and/or the platform
  • Updated android sdk/build tools. Since you're using cordova-android@8/ android sdk 28, you should be using build tools 28.
  • Consider upgrading to cordova-android@9 & updating android sdk to 29 / build tools 29

from cordova-plugin-network-information.

Chadori avatar Chadori commented on June 1, 2024 1

I've tried on Cordova Android 9.0.0 but there are still some startup crashes (not sure if it's still related to the permissions now, since the errors are gone and it's still using target28 even on CA-9.0.0.). I'm suspecting it's the exporter having issues, I'm going to check the from the engine's side, that I'm using, instead.

Thank you for the help.

from cordova-plugin-network-information.

Chadori avatar Chadori commented on June 1, 2024 1

Since I'm not sure what's causing this yet, I'll just close this and make a new thread if any case there is really something wrong.
Thanks.

from cordova-plugin-network-information.

breautek avatar breautek commented on June 1, 2024

What is your target SDK (or if you don't explicitly set it, what is your version of cordova-android)?

from cordova-plugin-network-information.

Chadori avatar Chadori commented on June 1, 2024

Hi,

Here are the build versions.

Cordova-Android : 8.1.0
android-minSdkVersion: 28
android-targetSdkVersion: 28

Thank you.

from cordova-plugin-network-information.

breautek avatar breautek commented on June 1, 2024

Hmm, I'm not reproducing this with a simple cordova app on an android 10 emulator.

It looks like for some reason, your app is missing the <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> declaration in your AndroidManifest.xml file. This is something the plugin adds on installation.

Can you confirm that line exists inside <project-root>/platforms/android/app/src/main/AndroidManifest.xml? It should appear as a child of the <manifest> tag somewhere.

from cordova-plugin-network-information.

Chadori avatar Chadori commented on June 1, 2024

Got it, I will confirm. Thanks.

from cordova-plugin-network-information.

breautek avatar breautek commented on June 1, 2024

Let me know if this issue can be closed.

If not, then I think we'll need a sample reproduction app to continue.

from cordova-plugin-network-information.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.