App can't run with Network error on Android

4 posts, 0 answers
  1. Kevin
    Kevin avatar
    4 posts
    Member since:
    Jun 2013

    Posted 09 Jun 2013 Link to this post

    Just want to figure out if I have missed anything, or it's really a bug.

    1. I opened a totally new Blank Project from Icenium Mist.

    2. Nothing added or edited with the default project. Just directly changed Properties for Android like the image below:
    http://i.imgur.com/GtMvA1b.png

    3. Run and build for Android, scan QR Code and install on Nexus 4, then nothing show up except this:
    http://i.imgur.com/KXr6GWc.png

    If I skip Step 2, the App will run successfully.
    If in Step 2 add "AccessNetworkState" permission, the app will works occasionally, but sometimes still have the same problem in Step 3 when rebuild.

    So I'm just wondering if these setting will crash or anything I did wrong.


    UPDATE:
    OK After many tests, the "Internet", "AccessNetworkState" & "WriteExternalStorage" permissions must be included to avoid crash. My assumption is Icenium needs access to SDCard to put project files and perform instant update via Internet, so these 3 permissions can't be put away. Don't know if this is the case when I publish the apps.
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 12 Jun 2013 Link to this post

    Hi Kevin,

    Your observation is correct and those three permissions are required when deploying on the device with LiveSync enabled (i.e. Build settings: Debug). We should probably consider disallowing users to remove required permissions from the list, thanks for bringing this to our attention.

    You do not need "WriteExternalStorage" if you build the app in Release mode (i.e. for publish).

    Regards,
    Steve
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Missed our first webinar, watch it here.
    Share feedback and vote for features on our Feedback Portal.
  3. Robert
    Robert avatar
    1 posts
    Member since:
    Aug 2013

    Posted 28 Aug 2013 Link to this post

    Hello.

    I am having this issue.

    If I remove "AccessNetworkState" and/or "Internet" permissions from the apps Android Properties Permissions List, my app will crash too.

    I changed the build settings to "Release" by right clicking on 'Workspace <app name here>' in the "Project Navigator" in Graphite and I still get a crash. Doesn't matter if I "Publish" and download the .apk (and install it on my device manually), or I use Build & Deploy (which installs it automatically on my device).

    How can I publish/create an app without requiring internet permissions when it isn't needed?

    Thanks.
  4. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 30 Aug 2013 Link to this post

    Hi Robert,

    Cordova is basically an implementation over the Android WebView, so some permissions are always required. To be on the safe side that your app would always function correctly, you should have at least

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

    There are various topics in Phonegap groups and StackOverFlow that elaborate on these and why they are required.

    Regards,
    Steve
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
Back to Top