Android Extension compile error manifest not found

W

Wraithious

Guest
Hi I'm making a native extension for android and when I try to compile or build it it fails for file not found, heres the compile error:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':23.2.1'.
> java.io.FileNotFoundException: Z:\23.2.1\AndroidManifest.xml (The system cannot find the file specified)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.419 secs
cmd /c "subst /d Z:"

Create finished: 5:16:26 PM


I have downloaded a couple of extensions to see what they might have done different, and the only thing i see that's different is that every one of them has a yymanifest.xml file included, when I open them they all have this format:
Code:
<?xml version="1.0"?>
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<files>
  <file md5=" ">extension name.extension.gmx</file>
  <file md5=" ">extension name\AndroidSource\Java\java file class name</file>
  <Signature></Signature>
  <PublicKey></PublicKey>
</files>
Notice how it says <!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!--> this means I shouldn't be writing this xml file and trying to add it to my project, so my question is why isn't the manifest file being created? how do I fix this? please help I've built this extension 17 times adjusting/learning as i go but this is the end result every time

im using early access, sdk support library 23.2.1, support repository 35, all build tools installed up to version 25
 
P

PlayLight

Guest
Hi I'm making a native extension for android and when I try to compile or build it it fails for file not found, heres the compile error:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':23.2.1'.
> java.io.FileNotFoundException: Z:\23.2.1\AndroidManifest.xml (The system cannot find the file specified)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.419 secs
cmd /c "subst /d Z:"

Create finished: 5:16:26 PM


I have downloaded a couple of extensions to see what they might have done different, and the only thing i see that's different is that every one of them has a yymanifest.xml file included, when I open them they all have this format:
Code:
<?xml version="1.0"?>
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<files>
  <file md5=" ">extension name.extension.gmx</file>
  <file md5=" ">extension name\AndroidSource\Java\java file class name</file>
  <Signature></Signature>
  <PublicKey></PublicKey>
</files>
Notice how it says <!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!--> this means I shouldn't be writing this xml file and trying to add it to my project, so my question is why isn't the manifest file being created? how do I fix this? please help I've built this extension 17 times adjusting/learning as i go but this is the end result every time

im using early access, sdk support library 23.2.1, support repository 35, all build tools installed up to version 25
Hi Wraithious,
can you post your full log in spoilers?
It should show the problem further up the log.
 
W

Wraithious

Guest
can you post your full log in spoilers?
It should show the problem further up the log.
ok heres the entire log:
Create started: 5:15:59 PM
"C:\Users\wraithious\AppData\Roaming\GameMaker-Studio-Early-Access\GMAssetCompiler.exe" /fU="C:\Users\wraithious\AppData\Local\gm_ttt_35757\a95436.txt" /c /m=android /config="Default" /tgt=8 /obob=True /obpp=False /obru=True /obes=False /i=3 /j=4 /cvm /tp=1024 /mv=1 /iv=0 /rv=0 /bv=493 /gn="Mergery" /td="C:\Users\wraithious\AppData\Local" /cd="C:\Users\wraithious\Documents\GameMaker\Cache" /sh=True /dbgp="6502" /hip="127.0.0.1" /hprt="51268" /optionsini="C:\Users\wraithious\AppData\Local\gm_ttt_35757\gm_ttt_82055\Mergery.ini" /o="C:\Users\wraithious\AppData\Local\gm_ttt_35757\gm_ttt_82055" "C:\Users\wraithious\Documents\GameMaker\Projects\Mergery.gmx\Mergery.project.gmx"

Reading project file....finished.
Compile Constants...finished.
Remove DnD...finished.
Compile Scripts...finished.
Compile Objects...finished.
Compile Timelines...finished.
Compile Triggers...finished.
Compile Rooms...finished.
Compile Extensions...finished.
Global scripts...finished.
Final Compile...finished.
Saving IFF file... C:\Users\wraithious\AppData\Local\gm_ttt_35757\gm_ttt_82055\Mergery.droid
Writing Chunk... GEN8
Writing Chunk... OPTN
Writing Chunk... LANG
Writing Chunk... EXTN
Writing Chunk... SOND
Writing Chunk... AGRP
Writing Chunk... SPRT
Writing Chunk... BGND
Writing Chunk... PATH
Writing Chunk... SCPT
Writing Chunk... GLOB
Writing Chunk... SHDR
Writing Chunk... FONT
Writing Chunk... TMLN
Writing Chunk... OBJT
Writing Chunk... ROOM
Writing Chunk... DAFL
Writing Chunk... TPAGE
Writing Chunk... CODE
Writing Chunk... VARI
Writing Chunk... FUNC
Writing Chunk... STRG
Writing Chunk... TXTR
0 Compressing texture... writing texture texture_0.png...
1 Compressing texture... writing texture texture_1.png...
2 Compressing texture... writing texture texture_2.png...
3 Compressing texture... writing texture texture_3.png...
Writing Chunk... AUDO
Writing Chunk... SCPT
Writing Chunk... DBGI
Writing Chunk... INST
Writing Chunk... LOCL
Writing Chunk... STRG
Stats : GMA : Elapsed=3802.2065
Stats : GMA : sp=30,au=0,bk=2,pt=0,sc=14,sh=2,fo=0,tl=0,ob=23,ro=2,da=3,ex=3,ma=15,fm=0x4C302470
cmd /c "subst Z: "C:\Users\wraithious\Documents\GameMaker\Cache\Mergery\Android\Default" && Z: && cd \com.roadhammergaming.Mergery && "C:\Users\wraithious\AppData\Roaming\GameMaker-Studio-Early-Access\Android\runner\gradle\gradlew" build -x assembleDebug "


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':23.2.1'.
> java.io.FileNotFoundException: Z:\23.2.1\AndroidManifest.xml (The system cannot find the file specified)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.419 secs
cmd /c "subst /d Z:"

Create finished: 5:16:26 PM

EDIT: heres a link to the extension gmez so you can see how it's set up https://drive.google.com/open?id=0B4uEFC9Ii8Bnd1FhZllIbUR6aVE

and here's the setup step by step in creating the extension:
edit extension package properties-general tab-

name- DirectoryPicker
android checkbox ticked
edit extension package properties-android tab-
Class name- DirectoryPicker
Permissions- android.permission.WRITE_EXTERNAL

edit extension file properties box-
name- DirectoryPicker.extension.gmx
copys to- ticked android and android yyc boxes only

edit extension functions box-
name- folderLoader
external name- folderLoader
help- folderLoader(double FolderOnly, double ShowHidden)
return type box- selected double
key and value box- argument 0 double argument1 double

the calling code for an object's left mouse pressed event:
folderLoader(1.0, 0.0);

I have injected this into the manifest:

<activity android:name="${YYAndroidPackageName}.DirectoryPicker" > <intent-filter> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </activity>
 
Last edited by a moderator:
P

PlayLight

Guest
Are you using any injections to Gradle dependencies and/or the Android Manifest?
How are you adding your Java source files and place holders to your extension?
 
W

Wraithious

Guest
Are you using any injections to Gradle dependencies and/or the Android Manifest?
How are you adding your Java source files and place holders to your extension?
sorry I just edited my last post with all the info I could think of
 
P

PlayLight

Guest
Are you using any injections to Gradle dependencies and/or the Android Manifest?
How are you adding your Java source files and place holders to your extension?
There is quite a few problems here, but you are at least heading in the right direction.
I won't give you all the answers as i belive it will be more valuable to you to work out some of the code related problems yourself,
which will in turn help you understand how Android native Extension work with GM:S.

This information will amend the Extension construction, after that it will be only code related problems that need attention.

First off, you are including a number of random files (jar, md5, pom, arr, sh1) in the Extensions SDK folder which is not what the SDK folder is used for.
To be honest, there is very few reason to why you would need to include SDK files within your extension so i wont go into those reasons here.
You can simply remove the SDK folder all together as the files in there are not required and are just causing confliction.

I'm guessing that you were trying to include the AppCompat library to your Extension to support certain default styles for your custom layouts.
First of all, if you need to include 3rd party libraries with your Extension, then these libs will usually go under 'AndroidSource\libs\' under your Extension directory.
That being said, in this case the android-support-v7-appcompat.jar is already available (in the Android SDK) and does not need to be physically added to your extension.
You may simple inject the following to gradle dependency to include it on build.
Code:
compile 'com.android.support:appcompat-v7:+'
(If you're planning on publishing the Extension then you will also need to include module exclusion checks in order to work with other Extension using the same library.)

Next, with your Android Manifest injections, it looks as if you are trying to force your Activity Class as the Main launch Activity.
You will only need to use a simple Activity-injection to include your Activity Class, then call your Activity with the function you have added within your Class file.
To include your Activity Class in the Android Manifest:
Code:
<activity
    android:name=".DirectoryPicker"
    android:label="DirectoryPicker" />
This will get you back on track, however on your next build you are going to come across an error in your extensions code.
The problem will be clearly stated in your log and you should be able to amend it yourself from here.


Edit:
Just an additional note, don't touch the yymanifest.xml file. :)
 
Last edited by a moderator:
W

Wraithious

Guest
I'm guessing that you were trying to include the AppCompat library to your Extension to support certain default styles for your custom layouts.
yep, I was trying to implement the hollo light/ dark actionbar theme and kept getting compile errors saying it had no parent reference

Next, with your Android Manifest injections, it looks as if you are trying to force your Activity Class as the Main launch Activity
yep again, I was getting errors that it could not find my function in the javascript so i tried forcing it

Thank you very much for helping me I'm going to get to work on this, I know the java file it'self isnt perfect yet either but it graphically looks nice in the software I made it in and thanks again for sending me in the right direction, there are no good tutorials online that deal with any of the gradle or sdk or manifest injection aspects and ettiquit of making extensions
 
P

PlayLight

Guest
yep, I was trying to implement the hollo light/ dark actionbar theme and kept getting compile errors saying it had no parent reference



yep again, I was getting errors that it could not find my function in the javascript so i tried forcing it

Thank you very much for helping me I'm going to get to work on this, I know the java file it'self isnt perfect yet either but it graphically looks nice in the software I made it in and thanks again for sending me in the right direction, there are no good tutorials online that deal with any of the gradle or sdk or manifest injection aspects and ettiquit of making extensions
Yeah the basic example is just that, very basic.
Have a look through the Class files in 'AppData\Roaming\\Android\*', especially RunnerJNILib. There are some very handy methods which you can call on from within your own extensions. I see you're already using CreateAsynEventWithDSMap().

Just a quick note, with your extensions >path return< via Async, you are returning the absolute path. Keep in mind that GM:S functions are sand boxed and won't be able to reference this address.
The easiest way to avoid this is to either move or copy the selected file to Working Directory (//data//data//<package name>//files//) and access it from there, if you're looking to access external files.

Gradle Dependency Management
<< helpful info on Gradle Dependencies
 
Last edited by a moderator:
W

Wraithious

Guest
Just a quick note, with your extensions >path return< via Async, you are returning the absolute path
yes basically I'm trying to have the user find a folder to save artwork they produce from my app into a folder of their choice starting from the picture gallery, I tried without extensions to do it and had no luck so i decided to try making an extension. I've got it to the point where it loads the game now, you're right there were a few errors in the java file, an extra un needed intent, didn't need the onCreate event, also somehow an underscore worked it's way into my function definition box lol, currently im fighting with why it can't find my function in the java file when i try to use the function in the game, it doesnt crash the game it just shows the cant find folderLoader : null error in the runner command box but I'll figure it out and definatly will read the class files, the link and the JNIlib methods you mentioned to get a better grip on all of this

yep JNIlib java file very usefull, studying my error code about half way down the page there now haha Thanks again for the help!!
 
Last edited by a moderator:
W

Wraithious

Guest
well the project is getting close, but I'm still having the same issue with EA Studio, it's NOT creating the yymanifest.xml file, and in the compile command window when trying to use my extension says:
Can't find method on extension class:null
I have tried running it with the green run arrow, and the build project icon, altho it runs/builds the project fine now I get the same result of not being able to use the extension,
I have researched and researched, and yet I can't figure this out

EDIT: I have 2 other extensions in my project so I used a little project I had lying around with no extensions in it, I loaded my extension in it and have a simmilar error, it says

Exception thrown trying to call method on folderLoader

Now, when I was looking through the JNIlib file in gamemaker I found the block of code for these errors, in the first case it was finding the java class and not the initiating method (folderLoader(double, double)) but now with no other extensions involved it cannot find the extension java class, I'm positive its because gamemaker isn't making the yymanifest.xml file,
Please help me understand WHY it isn't being created??
 
Last edited by a moderator:
W

Wraithious

Guest
Solved the problem, it was dumb, I didn't use the java return function, I was looking so deeply into the project I overlooked something stupid, wasted over 80 hours on it, that'll teach me a lesson hahah
 
Last edited by a moderator:
K

komarios

Guest
yep, I was trying to implement the hollo light/ dark actionbar theme and kept getting compile errors saying it had no parent reference



yep again, I was getting errors that it could not find my function in the javascript so i tried forcing it

Thank you very much for helping me I'm going to get to work on this, I know the java file it'self isnt perfect yet either but it graphically looks nice in the software I made it in and thanks again for sending me in the right direction, there are no good tutorials online that deal with any of the gradle or sdk or manifest injection aspects and ettiquit of making extensions
Thanks a lot!
Your suggestion to look at the RunnerJNILib saved me, after days of endless google search to implement an SQLite database!
Referencing the context through RunnerJNILib was all that I was missing to solve my "Can't find method on extension class:null".
The code to get current context was :
RunnerJNILib.ms_context

after having imported the:
import com.yoyogames.runner.RunnerJNILib;

PM me if anyone needs a more thorough explanation or a complete example.
 
Top