After Migrating to Android Studio : attempt to index global 'network' (a nil value)

Hi,

I migrated one of my existing projects from ant to gradle in Android Studio, after so much killer tasks i successfully ran the project, but it has below error on network.request line in Corona.

attempt to index global 'network' (a nil value)

I searched this error in this forum and all the replies say that the problem was from accidentally using ‘network’ word as a variable name.but i searched all the folders and files in android and Corona and did not find any usage of ‘network’ word.also this problem did not exist before migrating to android studio.

This problem does not happen in corona simulator in mac and it happens just in android real device.

Thanks in advance

Hi arashmobileboy,

I’m guessing that your project does not have a plugin module included with it and just has an app module. In this case, you’ll need to add this line to the dependencies block of app/build.gradle.

compile fileTree(dir: "$coronaEnterpriseDir/Corona/android/lib/Corona/libs", include: '\*.jar')

Assuming that your app project is being compiled with some of the JAR files in the above directory, you’ll want to make sure that the network.jar file is being included.

thanks the problem solved with your help

Hi arashmobileboy,

I’m guessing that your project does not have a plugin module included with it and just has an app module. In this case, you’ll need to add this line to the dependencies block of app/build.gradle.

compile fileTree(dir: "$coronaEnterpriseDir/Corona/android/lib/Corona/libs", include: '\*.jar')

Assuming that your app project is being compiled with some of the JAR files in the above directory, you’ll want to make sure that the network.jar file is being included.

thanks the problem solved with your help