Error Compiling from Network Drive

tdocs2

Well-Known Member
Licensed User
Longtime User
I am trying to create a more structured development environment between my two development computers. Until now, I was passing my source code folder between the two computers and then restoring it to the other computer. I have B4A installed in both computers as well as all necessary Java components etc. I have a tablet for each computer - 7 inch and 10 inch both running Android 4.04. All was progressing great until today.

I need your help. I set up a folder called Android development in computer 1 and shared it to my wireless network. Under it, I have a subfolder B4android that contains all the samples I have downloaded as well as learning examples I have developed. I mapped said folder in computer 2 as the M: drive with full control. When I attempted to compile today from computer 2, I received this error:

Compiling code. 0.16
Compiling layouts code. 0.03
Generating R file. 0.44
Compiling generated Java code. Error
javac 1.7.0_07
src\b4a\filemethods\main.java:125: error: error while writing main.B4AMenuItemsClickListener: could not create parent directories
private class B4AMenuItemsClickListener implements android.view.MenuItem.OnMenuItemClickListener {
^
1 error

I tried it with two more programs and the same error ocurred. The src subfolder is 4 or 5 levels below the project folder and then 2 levels below the M: drive.

I am able to do everything in the M: drive, add folders, delete folders. for example,I just downloaded the B4A-Bridge source code from your site and installed it in the development folder under M:

I am using V2.20.

Thanks for your help.
 

jnbarban

Member
Licensed User
Longtime User
Hi, i have the same probleme... tdocs2 , do you have the solution ?

Erel, like you say, Administrator mode doesn't change anything ...
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
All my sources are getting compiled from a network share, works fine (both laptop and datashare run on XP)
 
Upvote 0

jnbarban

Member
Licensed User
Longtime User
Before last friday, work fine on my server. but this Week End, we have change the server and now i work on a new serveur. Since, i have this error.

We have give full Permission all of project folders...but nothing change.

It's strange because, in the src Folder, "main.java" was created by the compilation but the compilation says that is impossible to create the parent directories
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
I could not get it to work

Hi, i have the same probleme... tdocs2 , do you have the solution ?

Erel, like you say, Administrator mode doesn't change anything ...

I could not get it to work... I guess it could be a Norton issue. I spent some time on it, but gave up...
 
Upvote 0

jnbarban

Member
Licensed User
Longtime User
Ok, the compilation work fine on XP but not in Seven...Any idea ?

I was looking about "Thumbs.db" files make by seven who can bloc the creation of parent directory, but no result...


Help me please !!! :BangHead:
 
Upvote 0

kiki78

Active Member
Licensed User
Longtime User
Sorry to reactivate this old thread, but I compil all my project from network drive since more than 2 years without problem.
I update our server this week-end (Debian Wheezy too Jessie) and now I have the same error.
Does someone solve it or have a way ?

Regards
 
Upvote 0

kiki78

Active Member
Licensed User
Longtime User
I found solution that work for me :)
If your share is on server that use samba, add :
mangled names = no
to your share configuration in smb.conf.
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
I'm ignorant about Samba so forgive me if I'm way off track here - but won't this affect a whole bunch of stuff that is nothing to do with B4A?
I have had this problem for a while now, I used to be able to compile to a share on my Synology NAS but at some point (after an upgrade I believe) it stopped working.
 
Upvote 0

kiki78

Active Member
Licensed User
Longtime User
The mangled names is mainly use to allow connection of old client (Dos, Win95) that only support 8.3 naming.
It is also use if UNIX file name can't be correctly show in Windows.
So if you avoid special character in your file name, you probably not see difference, except you can compile your network B4A project :)
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
Thanks for the clarification kiki78.
I might try this after I've installed 5.0 ... although it means accessing my Synology at a lower level than I am used to.
 
Upvote 0

jmon

Well-Known Member
Licensed User
Longtime User
Has anyone found a solution for Windows? I'm trying to compile on another computer, using a network drive, same as @tdocs2 .

With a simple project like this one:
B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.SetFormStyle("UNIFIED")
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    MainForm.Show
   
    Log("Test")
End Sub

I get this error:
B4J version: 4.20 (1)
Parsing code. (0.00s)
Compiling code. (0.14s)
Compiling layouts code. (0.01s)
Compiling generated Java code. Error
javac 1.8.0_66
src\b4j\example\main.java:7: error: error while writing main: could not create parent directories
public class main extends javafx.application.Application{
^
1 error

I have full rights to the network share, I am admin on both computers. I also added "Everyone" with full permissions to all files in the folder.

The strange thing, is that the compiler managed to create the folders "src\b4j\example\", and also the main.java file.
Capture.PNG


The main.java file seems complete:
package b4j.example;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.debug.*;

public class main extends javafx.application.Application{
public static main mostCurrent = new main();

public static BA ba;
static {
ba = new anywheresoftware.b4a.ShellBA("b4j.example", "b4j.example.main", null);
ba.loadHtSubs(main.class);
if (ba.getClass().getName().endsWith("ShellBA")) {
anywheresoftware.b4a.ShellBA.delegateBA = new anywheresoftware.b4j.objects.FxBA("b4j.example", null, null);
ba.raiseEvent2(null, true, "SHELL", false);
ba.raiseEvent2(null, true, "CREATE", true, "b4j.example.main", ba);
}
}
public static Class<?> getObject() {
return main.class;
}


public static void main(String[] args) {
launch(args);
}
public void start (javafx.stage.Stage stage) {
try {
anywheresoftware.b4j.objects.FxBA.application = this;
anywheresoftware.b4a.keywords.Common.setDensity(javafx.stage.Screen.getPrimary().getDpi());
BA.Log("Program started.");
initializeProcessGlobals();
anywheresoftware.b4j.objects.Form frm = new anywheresoftware.b4j.objects.Form();
frm.initWithStage(ba, stage, 600, 400);
ba.raiseEvent(null, "appstart", frm, (String[])getParameters().getRaw().toArray(new String[0]));
} catch (Throwable t) {
BA.printException(t, true);
System.exit(1);
}
}


private static boolean processGlobalsRun;
public static void initializeProcessGlobals() {

if (main.processGlobalsRun == false) {
main.processGlobalsRun = true;
try {

} catch (Exception e) {
throw new RuntimeException(e);
}
}
}public static anywheresoftware.b4a.keywords.Common __c = null;
public static anywheresoftware.b4j.objects.JFX _fx = null;
public static anywheresoftware.b4j.objects.Form _mainform = null;
public static String _appstart(anywheresoftware.b4j.objects.Form _form1,String[] _args) throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(ba, "appstart"))
return (String) Debug.delegate(ba, "appstart", new Object[] {_form1,_args});
RDebugUtils.currentLine=65536;
//BA.debugLineNum = 65536;BA.debugLine="Sub AppStart (Form1 As Form, Args() As String)";
RDebugUtils.currentLine=65537;
//BA.debugLineNum = 65537;BA.debugLine="MainForm = Form1";
_mainform = _form1;
RDebugUtils.currentLine=65538;
//BA.debugLineNum = 65538;BA.debugLine="MainForm.SetFormStyle(\"UNIFIED\")";
_mainform.SetFormStyle("UNIFIED");
RDebugUtils.currentLine=65540;
//BA.debugLineNum = 65540;BA.debugLine="MainForm.Show";
_mainform.Show();
RDebugUtils.currentLine=65542;
//BA.debugLineNum = 65542;BA.debugLine="Log(\"Test\")";
anywheresoftware.b4a.keywords.Common.Log("Test");
RDebugUtils.currentLine=65543;
//BA.debugLineNum = 65543;BA.debugLine="End Sub";
return "";
}
}

I tried with a symbolic link, but I get the same error. Any Ideas?
 
Upvote 0

jmon

Well-Known Member
Licensed User
Longtime User
If your server is windows I think you can try it by reading https://support.microsoft.com/en-us/kb/121007.

Thanks @kiki78 !! It works, You're the best!
I also had to strip the 8dot3 names for the old files.

Warning!: I Recommend reading THIS and THIS to understand the possible consequences this following tutorial could have on some programs!

Here is a quick tutorial for WINDOWS (considering my files are in "E:\myFolder"):
  1. On your file server, open command prompt (cmd) as Administrator. To do so, go to "C:\Windows\System32", right click on cmd.exe, and select "Run as Administator".
  2. Enter:
    • B4X:
      fsutil.exe behavior set disable8dot3 1
    • --> That will disable the 8dot3name on all your drives. Please note that some old applications requiring 8dot3name may not work anymore.
  3. Then STRIP all the 8dot3name on your files:
    • B4X:
      fsutil.exe 8dot3name strip /s /v "E:\myFolder"
    • --> This part, took me about 10 minutes for ~250000 files.
I tested this on both Windows 7 SP1 and Windows Server 2012. Actually on Windows Server 2012, I previously stripped the 8dot3name, as Microsoft recommends it. Later on, I noticed that I could compile on my network Drives, but I didn't correlate that it was becuase of disabling the 8dot3name.

Thanks again!
 
Last edited:
Upvote 0
Top