android/build_app.sh

Hello everybody,

I tried to build my app using corona/platform/android/build_app.sh.
I did not found any documentation about this script on internet. Maybe it is obsolete ?

I had the following troubles :

  • Incompatible with Android NDK-r19c. I had to download an old NDK : NDk-r14b
  • I fight several hours with one of the makefiles who does not find module ‘cpufeatures’. Finally I resigned to copy this module from android-ndk-r14b/sources/android/cpufeatures to corona/plugins/cpufeatures. But this is just a turnaround.
  • …/app_sign sign  …/tmp/temp.36uGVH4yZmYd7P03/resource.car  …/lib/armeabi-v7a/libcorona.so little, gives the following error : “*** Failed to replace signature *** (ReplaceSignature)”.

I have no idea what to do now. Is there anybody who was able to build an Android App using the command line ?
 

You almost got there! Fail to replace the signature means that somehow app_sign can’t find magic code it tries to replace with signature. I would recommend removing app_sign from platform/android/build_server_output.sh and add " return true; " in line 107 of librtt/Rtt_Verifier.cpp.

I’m now working on rewriting build system to gradle & latest NDK. Should be ready in couple month. Btw, feel free to join our Slack, we have opensource channel.

Also, this is not recommended way to build Corona applications. If you want to build Applications, download Corona Simulator for free and build apps with it.

@vlads :

Thank you very much for your answer. I am very happy to have support from Corona.

The major problem using the Corona Simulator is that it calls an obscure function on the Corona Server during the app building process.

I definitely cannot use (and more work/modify) a software who is not Open Sources.

If I will work on Corona (a big IF), certainly, the first step will be to remove that call to a private procedure running on a private server from a private company.

Fair enough. This system was put in place at time when setting up all the pieces was very complicated on the desktop. Server builds were put in for convenience. I’m working currently on putting together system which will build Android apps on dev’s machine, not on server

Also, It just occurred to me that you can use Corona Native to build your apps. It’s much more packaged. You can also build native libraries yourself. To build your own Native libraries, run ./build.sh from subrepos/enterprise.

Thank you Vlads. Corona Native is exactly what I was looking for :slight_smile:

Still some problems :

  • The Official Download release version was buggy, building a file path to my splash-screen. It concatenated two absolute path, the second beginning with a ‘~’. Something like /foo/bar/~/foo/bar/xxx. I am sorry , but I did not write down the error message, because this issue was fixed when I cloned the github master branch.

  • Impossible to use the Android Simulator from Android Studio. I have the message : “INSTALL_FAILED_NO_MATCHING_ABIS”. Maybe some librairy for x86 are missing

  • When I use a real Android phone, I have a modal dialog box on the device : “Application Validation Error. Incorrect splash screen - the splash screen built into the app is not the one that shipped with build 2018.3326 of Corona”

It is not easy for me to patch this last problem. This Splash-Screen is really a big problem in the apps building.

I do not care fore now of this splash-screen. But it gives me many, many problems. And hard for me to solve those, because the signing process of the resource.car file is not so simple.

[EDIT] : Of course I have not problem to pay for the plugin who remove this splash-screen. Corona is a great product and it’s ok for me to pay a little bit for it.

But I am doubfull that after bying this plug-in, things will be better. Probably everything will be more complicate and will be more buggy.

All my tests was with “Native/Project Template” from Corona.

[EDIT2] OK Corona, you win ;-)  :

I bought your splash-screen plugin and everything is now better.

But I really suggest you clean all this mess around the splash-screen.

Thank you for buying splash screen plugin. It should not be an issue though, that was some problem. I will look into it later today or tomorrow.

I would suggest using latest Corona Daily. It has better Native project template. You can download daily builds here:

https://developer.coronalabs.com/downloads/coronasdk

About x86 - unfortunately now corona has only amrv7 build. I’m working on adding the other 3  (arm64, x84 and x86_64)

New buid process would also probably happen on client’s machine, so your initial worry about Simulator may go away.

To open it, open “android” directory with Android Studio.

Note: Android studio 3.4 was just released, and it has minimal requirements for gradle 5.1.1 and build tools 28. It will suggest fixed, and project should work after applying suggested fixes.

UPD: I just tried with my account which has no splashscreen plugin and there was no errors. Are you building it on mac or Windows?

Hey. So I want to followup on my promise of new build system.
It is not ready yet, but I put out some intermediate results. I shared detailed info in our Slack, #opensource channel, but long story short - now you can easily build for Android Corona from source code using latest tools and run it in sim. https://github.com/coronalabs/corona/tree/gradle/platform/android#how-to-build-coronas-android-software

Thank you for your work, Vlads. Actually I am working with Native Plugins for IOS and I have not any problems.

You almost got there! Fail to replace the signature means that somehow app_sign can’t find magic code it tries to replace with signature. I would recommend removing app_sign from platform/android/build_server_output.sh and add " return true; " in line 107 of librtt/Rtt_Verifier.cpp.

I’m now working on rewriting build system to gradle & latest NDK. Should be ready in couple month. Btw, feel free to join our Slack, we have opensource channel.

Also, this is not recommended way to build Corona applications. If you want to build Applications, download Corona Simulator for free and build apps with it.

@vlads :

Thank you very much for your answer. I am very happy to have support from Corona.

The major problem using the Corona Simulator is that it calls an obscure function on the Corona Server during the app building process.

I definitely cannot use (and more work/modify) a software who is not Open Sources.

If I will work on Corona (a big IF), certainly, the first step will be to remove that call to a private procedure running on a private server from a private company.

Fair enough. This system was put in place at time when setting up all the pieces was very complicated on the desktop. Server builds were put in for convenience. I’m working currently on putting together system which will build Android apps on dev’s machine, not on server

Also, It just occurred to me that you can use Corona Native to build your apps. It’s much more packaged. You can also build native libraries yourself. To build your own Native libraries, run ./build.sh from subrepos/enterprise.

Thank you Vlads. Corona Native is exactly what I was looking for :slight_smile:

Still some problems :

  • The Official Download release version was buggy, building a file path to my splash-screen. It concatenated two absolute path, the second beginning with a ‘~’. Something like /foo/bar/~/foo/bar/xxx. I am sorry , but I did not write down the error message, because this issue was fixed when I cloned the github master branch.

  • Impossible to use the Android Simulator from Android Studio. I have the message : “INSTALL_FAILED_NO_MATCHING_ABIS”. Maybe some librairy for x86 are missing

  • When I use a real Android phone, I have a modal dialog box on the device : “Application Validation Error. Incorrect splash screen - the splash screen built into the app is not the one that shipped with build 2018.3326 of Corona”

It is not easy for me to patch this last problem. This Splash-Screen is really a big problem in the apps building.

I do not care fore now of this splash-screen. But it gives me many, many problems. And hard for me to solve those, because the signing process of the resource.car file is not so simple.

[EDIT] : Of course I have not problem to pay for the plugin who remove this splash-screen. Corona is a great product and it’s ok for me to pay a little bit for it.

But I am doubfull that after bying this plug-in, things will be better. Probably everything will be more complicate and will be more buggy.

All my tests was with “Native/Project Template” from Corona.

[EDIT2] OK Corona, you win ;-)  :

I bought your splash-screen plugin and everything is now better.

But I really suggest you clean all this mess around the splash-screen.

Thank you for buying splash screen plugin. It should not be an issue though, that was some problem. I will look into it later today or tomorrow.

I would suggest using latest Corona Daily. It has better Native project template. You can download daily builds here:

https://developer.coronalabs.com/downloads/coronasdk

About x86 - unfortunately now corona has only amrv7 build. I’m working on adding the other 3  (arm64, x84 and x86_64)

New buid process would also probably happen on client’s machine, so your initial worry about Simulator may go away.

To open it, open “android” directory with Android Studio.

Note: Android studio 3.4 was just released, and it has minimal requirements for gradle 5.1.1 and build tools 28. It will suggest fixed, and project should work after applying suggested fixes.

UPD: I just tried with my account which has no splashscreen plugin and there was no errors. Are you building it on mac or Windows?

Hey. So I want to followup on my promise of new build system.
It is not ready yet, but I put out some intermediate results. I shared detailed info in our Slack, #opensource channel, but long story short - now you can easily build for Android Corona from source code using latest tools and run it in sim. https://github.com/coronalabs/corona/tree/gradle/platform/android#how-to-build-coronas-android-software

Thank you for your work, Vlads. Actually I am working with Native Plugins for IOS and I have not any problems.