Compiler error while switching to android

I had it set to web player and had no compiller errors now that i switch to android i come up with this

NullReferenceException
UnityEngine.Camera.ScreenPointToRay (Vector3 position) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/Editor/UnityEngineCamera.cs:379)
Paddle.Update () (at Assets/Scripts/Paddle.js:11)

My code for the Paddle.js script is

//declare the raycast objects here so we dont need to instantiate them each frame
private var ray : Ray;
private var rayCastHit : RaycastHit;

//***************************************************
function Update()
{

	if(Input.GetMouseButton(0))
	{
		ray = Camera.main.ScreenPointToRay (Input.mousePosition);
		
			if (Physics.Raycast (ray, rayCastHit))
			{
				transform.position.x = rayCastHit.point.x;
			}
		}
}
//*****************************************************

if (Input.GetButtonDown (“Fire1”))
{

This works for both PC mouse clicks and mobile tap screen controls.

This should work fine:

 ray = Camera.main.ScreenPointToRay (Input.mousePosition);

if (Physics.Raycast (ray, rayCastHit))

You may need to add a range for the cast and add layerMask to ignore if necessary though:

  if (Physics.Raycast (ray, rayCastHit, 100, layerMaskExample))