Blackscreen after compil with phonegap build

Do you know something that can make blackscreen happen when i launch my game apk?
I tried to compil it with phonegab builder at the very beginning of my game and it was ok.
Maybe something related to save file or admob? I just add an ad mob object without any admob ID or admob plugin in phonegap…

Probably the admob, yes. Note that the admob object is deprecated, has been replaced by a new admob extension that works through events only (conditions and actions, no objects).
You “activate” this extension writing a value (any value) in the admob application ID in the project settings. Doing it GD adds the plugin information on game export, so cordova will install the admob plugin.

No idea how phonegap works, and not sure if the admob extension is compatible with it, I’ve the impression that phonegap and cordova are closely related and it may work, but not sure :confused:

“Note that the admob object is deprecated, has been replaced by a new admob extension”

Replaced In gdevelop 5?

“I’ve the impression that phonegap and cordova are closely related”

I think i read somewhere that cordova is based on phonegap…

At first i tried to compil with cordova but i didn’t make it… The tutorials i found wasn’t clear enough for me… If you know a step by step with details tutorial let me know :smiley:
I would prefer to use cordova rather than phonegap build…

From what I’ve researched, Phonegap is Adobe’s custom distribution of Apache’s Cordova. Kind of like how Debian is a distribution of Linux (Phonegap = Debian, Cordova = Linux).

If you want to help me:
I installed nojes
Installed npm
Installed cordova with npm
Installed android sdk
Installed java sdk
Exported my game in gdevelop so i have a folder with inside : another folder called “www” and an XML file
And now… I don’t know :smiley:

Have you seen this: wiki.compilgames.net/doku.php/gd … ng_cordova ?

Yes i read it already :

“After that, navigate to your Cordova project’s directory”
Basically:

  • i don’t know how to “open” the files created with gdevelop in cordova
  • i don’t know what to do with XML file exported with gdevelop. Do i have to cut/paste it somewhere?
    I’m sorry but i am a total noob with console commands and html…

I’ve not tried any of this myself, but my understanding of that article is that it’s all done via the command line. Changing to a directory, on Linux, is done by cd path/to/cordova/
If you’re on Windows or Mac you’ll have to Google it as it might be different. Once you’re in the Cordova directory on the command line, you should be able to follow the rest of the steps there.

Yes, new admob extension in GD, it supports rearward videos too :slight_smile:

About manual cordova compiling, there is no guide for it specific for GD, mainly because you’ve the online build service that does the work for you, free two times per day. But also because there is a lot to explain: installing every tool you need, make sure you install compatible versions, make sure the tools were added to the system PATH variable or add them yourself, to do it you have to know what and where is the launcher. You’ve to know or the tutorial should teach how to use the command line, and finally the easy part, launching the cordova commands listed in the cordova page.

All that assuming you know how to read and solve errors in the command line, because there will be errors, there are always errors. And the errors won’t be “Your version of java is incompatible, please install Java Sdk 8.10.1”, things will fail and you’ll have to be open to the option it may be because version compatibility, investigate, know which tool is the problem, reinstall, try again.

And, finally, if we officially support this manually-building tutorial, lot of users that doesn’t really know how to handle the errors will start bloating the forum with an infinite amount of different errors, and we’ll have to add specific information to fix each one in the tutorial. A missing tool, a bad installed tool, a bad tool version, a tool not added to the PATH, all that for ever tool… java memory limit reached, bad game path, npm not working, npm failing to install cordova, cordova not launched because installed locally, and the worst one: cordova fails to compile the project (or even worse, it compiles but you get a black screen in-game, harder to get the error message), meaning the installed cordova version is incompatible for some reason (probably a plugin) and you have to reinstall an older npm and try again :frowning:

That was very long, sorry, but needed to explain the huge amount of work a tutorial would take, the tutorial would be 50 times longer, 100 times more boring and 1000 times more technical my message was… too much work for something already available, simple, automatic and for free :smiley:

Said that, I’ve helped in discord chat a couple of times to compile manually, but just because there was a good reason to use it (manual buildings of GD for a non-supported OS or architecture can’t use the online build service) and only answering very specific questions, as what could generate this error, is this command ok, etc. :slight_smile:

@ BWpanda : thanks for your reply
@ lizard : you should have say " it’s too hard for you, leave cordova alone!" :smiley:
I’m gonna try the already available, simple, automatic and for free solution. Thanks for your help

It’s too hard to everybody that is not used for the command line nor ugly error codes debugging and doesn’t have a tutorial. With a tuto you would be able to do it, I’m sure, but it’s too much work, sorry :frowning:

Also, the message was not only for you, but to link to everybody that asks this :smiley:

The built-in solution is great, but if (for whatever reason) you need something more custom (like adding third-party libraries to the generated index.html file before compiling), then you’ll need to use either Cordova or Phonegap. As you know, Cordova requires you to install everything yourself and, as @Lizard-13 explained, this can be tricky/near-impossible for some people. In that case, as I understand it, Adobe’s PhoneGap Build is a better option as they’ve built everything for you and you just submit your project files for compilation: build.phonegap.com/

iHere i am again :cry:
I converted my gdevelop4 project into a gdevelop5 one. Then resolved a few bugs and tried to export my project to an apk with gdevelop but… The download link provided at the end of the process provide me a zip file called “mygame. Zip” and inside 3 folders called “assets” “meta-inf” and “res”. And 3 files called “classes. Dex” “resources. Arc” and “androidmanifest. Xml”… :question:
And when i look in gdevelop “all your builds” the project is tagged as “cordova build”
Any idea?
build-log.txt (38.9 KB)

Should give you an apk file :confused:
Have you selected the first exporting option, the Android one?

Last lines in your log:

17s\n47 actionable tasks: 47 executed\nBuilt the following apk(s): \n\t/app/build/outputs/apk/release/app-release.apk\n","build_date":"2019-01-17 13:14:16

It generates the apk, no idea what happened, give it another try, if you get the same result open an issue on GitHub :neutral_face:

Yes i did… 4 times and same result…
I think I’m cursed :cry: :cry: :cry:

You know, I had the idea hours ago but was busy, I think that IS the apk file actually… try to rename “mygame.zip” to "mygame.apk"and see if that works :slight_smile:
Even if it works there’s a problem since it isn’t the common behavior.

EDIT: I see it was already suggested on GitHub and is working :smiley:

Sorry! Forgot to answer you… Was playing MY GAME on MY PHONE :sunglasses:
Yes i think it still an issue but i think 4ian didn’t understand me.