Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

App runs fine on simulator, can't find image on Android Device
Started by nml2727 Nov 24 2019 07:50 AM

9 replies to this topic
ponytiled tiled runtime error nil image nil android android device
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

nml2727

[GLOBAL: userInfoPane.html]
nml2727
  • Enthusiast

  • 66 posts
  • Corona SDK

My app works fine on the simulator, but when I build and copy the apk to my android phone, when pony tiled tries to load the first map, it seems it can't find an image:

 

Runtime Error

 

C:\Users\Nelson\Desktop\Blueberry_Escape\com\ponywolf\ponytiled.lua:204: attempt to index local 'image' (a nil value)

 

 

 

Apart from building for android from the simulator and then copying over the apk file and installing from that, are there any other steps I need to take to build to android?

 

 

The json tiled map files have the image path in the format like this:

 

"image":"..\/sprites\/tiles\/beach\/beach_vert.png"   

 

I don't see any issues with it and like I said everything works fine on the simulator.

 

Any help would be much appreciated. 



[TOPIC: post.html]
#2

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,867 posts
  • Corona SDK

Android file names are case sensitive, whereas the simulator won't care. Check the path is exactly correct. 



[TOPIC: post.html]
#3

nml2727

[GLOBAL: userInfoPane.html]
nml2727
  • Enthusiast

  • 66 posts
  • Corona SDK

As far as I can tell I've used lowercase everywhere. Is there some way to see the exact file path that the Android device is looking for?

[TOPIC: post.html]
#4

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,020 posts
  • Corona SDK

There's usually a notification on the console that the path or filename differs on disk. It could also be that your filename itself is capitalised, e.g. .PNG, .JPEG, etc.



[TOPIC: post.html]
#5

nml2727

[GLOBAL: userInfoPane.html]
nml2727
  • Enthusiast

  • 66 posts
  • Corona SDK

When you say console do you mean in the simulator when I'm building the APK file or somewhere on the Android phone I can go to?

[TOPIC: post.html]
#6

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,020 posts
  • Corona SDK

Yes, the Corona Simulator Console.



[TOPIC: post.html]
#7

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,601 posts
  • Corona SDK

You can also use adb to look at the on device console output.

 

https://docs.coronalabs.com/guide/basics/debugging/index.html



[TOPIC: post.html]
#8

nml2727

[GLOBAL: userInfoPane.html]
nml2727
  • Enthusiast

  • 66 posts
  • Corona SDK

Sorry for the dumb question, but does adb get installed on my windows PC or the Android device?

[TOPIC: post.html]
#9

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,601 posts
  • Corona SDK

On your Windows machine. 

 

You then connect your device to your Windows machine and debug with ADB.

 

You may need to unlock developer mode on your device and/or allow USB debugging too.  Look under settings for enabling USB debugging.

 

 

 

Everything else you need to know is in that second link in my prior post (https://docs.coronalabs.com/guide/basics/debugging/index.html#device-debugging-android).



[TOPIC: post.html]
#10

nml2727

[GLOBAL: userInfoPane.html]
nml2727
  • Enthusiast

  • 66 posts
  • Corona SDK

Well, tried to follow the steps in the second link but I'm not seeing an installer anywhere.  

 

I downloaded the sdk-tools-windows-4333796.zip    under the command line tools only section.   Now I'm stuck on  " Install the tools. On Windows, run the installer".   

 

I see a lot of windows batch files and a few applications but none of them look like an installer to me.

 

Seems like I must be doing something wrong... I doubt it should be so difficult to figure out how to install the tools




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: ponytiled, tiled, runtime error, nil, image nil, android, android device