building for android devices on mac give me error, on windows its all fine

hi, tried to build an android version on a mac it gave me this error:

BUILD FAILED
                     /Applications/Corona-3124/Corona 
Simulator.app/Contents/Resources/build.xml:462: The following error 
occurred while executing this line:
                     /Applications/Corona-3124/Corona 
Simulator.app/Contents/Resources/build.xml:399: Failed to copy 
db/vasco_gama.db to 
/var/folders/0_/0jl97qgn5jv0ynncxhmpcwsc0000gp/T/CLtmp0gwsQv/output/assets/db/vasco_gama.db 
due to Bad address

                     Total time: 1 second
ago 24 04:48:32.950
ago 24 04:48:33.153 Android build failed (256) after 29 seconds
ago 24 04:48:33.492 ERROR: Build Failed: Error code: 256
ago 24 04:48:33.493

in windows android build runs flawlessly.

i tried to change my copy code using corona code to copy files showed here:

https://docs.coronalabs.com/guide/data/readWriteFiles/index.html

with still same error. i can run the app fine on mac, but when i tried to build for android it will give me this error.

if i build for IOS it will create a successful build.

 i’m clueless why i cant create an android build on mac, and in windows it runs perfectly.

What do you mean by your “copy code”?

On macOS, Corona should give you the option to install the app to your device for you. Or you can use “adb” from the command line. Can you provide more details on what you’re trying to do?

Thanks

Rob

copy code is this code:

function copyFile( srcName, srcPath, dstName, dstPath, overwrite ) local results = false local fileExists = doesFileExist( srcName, srcPath ) if ( fileExists == false ) then return nil -- nil = Source file not found end -- Check to see if destination file already exists if not ( overwrite ) then if ( fileLib.doesFileExist( dstName, dstPath ) ) then return 1 -- 1 = File already exists (don't overwrite) end end -- Copy the source file to the destination file local rFilePath = system.pathForFile( srcName, srcPath ) local wFilePath = system.pathForFile( dstName, dstPath ) local rfh = io.open( rFilePath, "rb" ) local wfh, errorString = io.open( wFilePath, "wb" ) if not ( wfh ) then -- Error occurred; output the cause print( "File error: " .. errorString ) return false else -- Read the file and write to the destination directory local data = rfh:read( "\*a" ) if not ( data ) then print( "Read error!" ) return false else if not ( wfh:write( data ) ) then print( "Write error!" ) return false end end end results = 2 -- 2 = File copied successfully! -- Close file handles rfh:close() wfh:close() return results end -- Copy "readme.txt" from "system.ResourceDirectory" to "system.DocumentsDirectory" copyFile( "readme.txt", nil, "readme.txt", system.DocumentsDirectory, true )

it’s used to copy files. i had mine, but i could not create an android build on mac. from the error it gave:

 /Applications/Corona-3124/Corona Simulator.app/Contents/Resources/build.xml:462: The following error occurred while executing this line: /Applications/Corona-3124/Corona Simulator.app/Contents/Resources/build.xml:399: Failed to copy db/vasco\_gama.db to /var/folders/0\_/0jl97qgn5jv0ynncxhmpcwsc0000gp/T/CLtmp0gwsQv/output/assets/db/vasco\_gama.db due to Bad address

i assumed was about my copy file code i had…so i remove it and used corona code, but i still have the same error.

the funny part is that if i build in the same mac with the same code for IOS device. it will work fine. only if i trie to build for android it will give me this error. most likely is a mac simulator problem, (on windows works fine also) but first i need to know if any understand this report.

The code you provided is code that should run by your app the first time it starts up. It has nothing to do with the building processing. If you’re getting that error when building, something else is going on.

is this happening while Corona is trying to build the app?

Are you having Corona copy your app to the device by the dialog box?

yes, this is happening while corona is trying to build the app.

if i build an app for IOS, it will not give error.

if i build an app for Android on Windows, it will not give error.

only if i buid and app for Android on Mac.

don’t have a clue why this happens.

i was trying to build from a network drive.

i copied all files to the local mac drive. and all worked fine. build app was created successfully.

so i guess its a mac problem accessing the network.

*edit* or corona for mac doesn’t “like” to build over network.

Did the path to the source database file have spaces in it? Any UTF8 characters?

the path is:

\\server\Geral\2 - Programadores\Projectos em Curso 2016\Vasco da Gama 1.02\db

i passed the directory to local mac drive worked fine.

but i doubt the problem is in corona side. it seams more a problem of my mac and network.

note: i tried to copy this directory to the mac and it failed with -50 code (corona closed and all files closed). i had to make a copy of that directory in the server (in the same base directory) and only after i could pass it to the mac. i guess is a problem with my server and the mac. sometimes i try to delete files and it says i can’t even if its closed. i need to go to my pc and delete it from there.

What do you mean by your “copy code”?

On macOS, Corona should give you the option to install the app to your device for you. Or you can use “adb” from the command line. Can you provide more details on what you’re trying to do?

Thanks

Rob

copy code is this code:

function copyFile( srcName, srcPath, dstName, dstPath, overwrite ) local results = false local fileExists = doesFileExist( srcName, srcPath ) if ( fileExists == false ) then return nil -- nil = Source file not found end -- Check to see if destination file already exists if not ( overwrite ) then if ( fileLib.doesFileExist( dstName, dstPath ) ) then return 1 -- 1 = File already exists (don't overwrite) end end -- Copy the source file to the destination file local rFilePath = system.pathForFile( srcName, srcPath ) local wFilePath = system.pathForFile( dstName, dstPath ) local rfh = io.open( rFilePath, "rb" ) local wfh, errorString = io.open( wFilePath, "wb" ) if not ( wfh ) then -- Error occurred; output the cause print( "File error: " .. errorString ) return false else -- Read the file and write to the destination directory local data = rfh:read( "\*a" ) if not ( data ) then print( "Read error!" ) return false else if not ( wfh:write( data ) ) then print( "Write error!" ) return false end end end results = 2 -- 2 = File copied successfully! -- Close file handles rfh:close() wfh:close() return results end -- Copy "readme.txt" from "system.ResourceDirectory" to "system.DocumentsDirectory" copyFile( "readme.txt", nil, "readme.txt", system.DocumentsDirectory, true )

it’s used to copy files. i had mine, but i could not create an android build on mac. from the error it gave:

 /Applications/Corona-3124/Corona Simulator.app/Contents/Resources/build.xml:462: The following error occurred while executing this line: /Applications/Corona-3124/Corona Simulator.app/Contents/Resources/build.xml:399: Failed to copy db/vasco\_gama.db to /var/folders/0\_/0jl97qgn5jv0ynncxhmpcwsc0000gp/T/CLtmp0gwsQv/output/assets/db/vasco\_gama.db due to Bad address

i assumed was about my copy file code i had…so i remove it and used corona code, but i still have the same error.

the funny part is that if i build in the same mac with the same code for IOS device. it will work fine. only if i trie to build for android it will give me this error. most likely is a mac simulator problem, (on windows works fine also) but first i need to know if any understand this report.

The code you provided is code that should run by your app the first time it starts up. It has nothing to do with the building processing. If you’re getting that error when building, something else is going on.

is this happening while Corona is trying to build the app?

Are you having Corona copy your app to the device by the dialog box?

yes, this is happening while corona is trying to build the app.

if i build an app for IOS, it will not give error.

if i build an app for Android on Windows, it will not give error.

only if i buid and app for Android on Mac.

don’t have a clue why this happens.

i was trying to build from a network drive.

i copied all files to the local mac drive. and all worked fine. build app was created successfully.

so i guess its a mac problem accessing the network.

*edit* or corona for mac doesn’t “like” to build over network.

Did the path to the source database file have spaces in it? Any UTF8 characters?

the path is:

\\server\Geral\2 - Programadores\Projectos em Curso 2016\Vasco da Gama 1.02\db

i passed the directory to local mac drive worked fine.

but i doubt the problem is in corona side. it seams more a problem of my mac and network.

note: i tried to copy this directory to the mac and it failed with -50 code (corona closed and all files closed). i had to make a copy of that directory in the server (in the same base directory) and only after i could pass it to the mac. i guess is a problem with my server and the mac. sometimes i try to delete files and it says i can’t even if its closed. i need to go to my pc and delete it from there.