Android Question "File name or extension is too long" error

Rubsanpe

Active Member
Licensed User
Hi. When I compile the app in B4A I get the message

...
Compiling generated Java code. Error
File name or extension is too long

But it doesn't mention which file it refers to. I have tried to shorten the length of code filenames and layouts, but I can't fix it. Is there any way to find out which file is the cause?

I get the error in the system language (Spanish) and not in the one I have configured in the IDE.

Rubén
 

Rubsanpe

Active Member
Licensed User
Hi, I have tried to change the project folder to a shorter one and I have also tried to change the names of B4XPages and layouts.

The current path of the project is "C:\B4X\Proyectos\BO". Until yesterday it was working without problem and it was in "C:\B4X\Basic4Android\Proyectos\BoletinesOficiales".

As it does not work with these changes I understand that the problem must be in the size of the name of some of the files, but I have reduced the size of the last ones that I have modified but it does not let me continue.

I am currently using the recommendations from the B4X installation page and using JDK11.

Rubén
 
Upvote 0

Rubsanpe

Active Member
Licensed User
Hello again. Strangely I have made a cleanup of the project folder and I have removed some libraries that told me in the logs that they were no longer used in the project and now I don't get the error again when compiling.

I will continue testing

Rubén
 
Upvote 0

Rubsanpe

Active Member
Licensed User
Well, one day later the problem reappears. I have tried compiling other projects with no problem. It's an error that comes and goes. Yesterday after cleaning the directory, the problem disappeared, but now it doesn't disappear again.

I have tried disabling the antivirus as indicated in other threads.

I have placed the project in the root of the disk in c:\BoletinesOficiales and there it continues giving the error.

Rubén
 
Upvote 0

Rubsanpe

Active Member
Licensed User
Hi. The log is:

B4X:
Build modules tree: 0
B4A version: 11.00
.Net version: 4.0.30319.42000
Ini folder: C:\Users\rsanc\AppData\Roaming\Anywhere Software\Basic4android
UDP server: 192.168.1.12, broadcast: 192.168.1.255
Global Java version: 11
Gui: 1010
Build modules tree: 0
Gui: 830
ExitCode: 0
Output:

Error:

optimized dexer: System.Collections.Generic.KeyNotFoundException: La clave proporcionada no se encontró en el diccionario.
   en System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   en h9.get_Item(a key)
   en h2.ax()
   en l.c()
Build modules tree: 320
Build modules tree: 13
CompilingManager: not ready
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
Build modules tree: 2
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
Gui: 2135
Build modules tree: 24
opt: waiting for connection on port: 20879
opt: *************************
opt: waiting for latch(1).
Compilation task: 2348.9115
Gui: 131
Compilation task: 1503.7033
Gui: 334
link  --auto-add-overlay --no-version-vectors --manifest AndroidManifest.xml -I "C:\Android\AndroidSDK_B4A\platforms\android-30\android.jar" bin\extra\compiled_resources\com.clarionero.boletinesoficiales.zip -R bin\extra\compiled_resources\icon.zip  -R bin\extra\compiled_resources\com.github.barteksc.pdfviewer.zip  --extra-packages com.github.barteksc.pdfviewer  -R bin\extra\compiled_resources\androidx.core.zip  --extra-packages androidx.core  -R bin\extra\compiled_resources\com.google.android.gms.ads.impl.zip  --extra-packages com.google.android.gms.ads.impl  -R bin\extra\compiled_resources\androidx.browser.zip  --extra-packages androidx.browser  -R bin\extra\compiled_resources\androidx.coordinatorlayout.zip  --extra-packages androidx.coordinatorlayout  -R bin\extra\compiled_resources\androidx.drawerlayout.zip  --extra-packages androidx.drawerlayout  -R bin\extra\compiled_resources\androidx.swiperefreshlayout.zip  --extra-packages androidx.swiperefreshlayout  -R bin\extra\compiled_resources\com.google.android.gms.common.zip  --extra-packages com.google.android.gms.common  -R bin\extra\compiled_resources\androidx.fragment.zip  --extra-packages androidx.fragment  -R bin\extra\compiled_resources\com.google.android.gms.ads.zip  --extra-packages com.google.android.gms.ads  -R bin\extra\compiled_resources\androidx.work.zip  --extra-packages androidx.work  -R bin\extra\compiled_resources\com.google.firebase.messaging.zip  --extra-packages com.google.firebase.messaging  -R bin\extra\compiled_resources\com.google.android.gms.base.zip  --extra-packages com.google.android.gms.base  -R bin\extra\compiled_resources\androidx.media.zip  --extra-packages androidx.media  -R bin\extra\compiled_resources\com.google.android.material.zip  --extra-packages com.google.android.material  -R bin\extra\compiled_resources\androidx.appcompat.zip  --extra-packages androidx.appcompat  -R bin\extra\compiled_resources\androidx.appcompat.resources.zip  --extra-packages androidx.appcompat.resources  -R bin\extra\compiled_resources\androidx.cardview.zip  --extra-packages androidx.cardview  -R bin\extra\compiled_resources\androidx.annotation.experimental.zip  --extra-packages androidx.annotation.experimental  -R bin\extra\compiled_resources\androidx.recyclerview.zip  --extra-packages androidx.recyclerview  -R bin\extra\compiled_resources\androidx.transition.zip  --extra-packages androidx.transition  -R bin\extra\compiled_resources\androidx.viewpager2.zip  --extra-packages androidx.viewpager2  -A bin\extra\assets  -A "C:\Android\AndroidSDK_B4A\tools\..\extras\b4a_local\unpacked-googleconsent-63761757610000\assets" -o bin\temp.ap_ --java gen
System.ComponentModel.Win32Exception (0x80004005): El nombre del archivo o la extensión es demasiado largo
   en System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   en System.Diagnostics.Process.Start()
   en f4.a(Process A_0, Boolean A_1, DataReceivedEventHandler A_2, DataReceivedEventHandler A_3, String A_4)
   en f4.d.g()
   en cc.a(Object A_0)
Compilation task: 21564.6908
OptimizedDexer exitCode=-1
dontWait=True
Gui: 672
 
Upvote 0

Rubsanpe

Active Member
Licensed User
Hi again. Yes the error is indeed only with this project. The complete list of libraries of the project is in the image.

Captura.PNG


Best regards and thanks

Rubén
 
Upvote 0

Rubsanpe

Active Member
Licensed User
Have you tried it?

Hi. Sorry I didn't read that part. I have created a new B4XPages project (default content), added the same libraries to it, and the error does not occur.

B4X:
B4A Version: 11.00
Parsing code.    (0.30s)
    Java Version: 11
Building folders structure.    (0.03s)
Running custom action.    (0.11s)
Compiling code.    (0.42s)
Compiling layouts code.    (0.02s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (1.49s)
Linking resources    (0.48s)
Compiling debugger engine code.    (4.61s)
Compiling generated Java code.    (4.21s)
Convert byte code - optimized dex.    (5.38s)
Copying libraries resources    (15.79s)
ZipAlign file.    (0.10s)
Signing package file (private key).    (1.69s)
Installing file to device.    Error
No device found.

Rubén
 
Upvote 0

Rubsanpe

Active Member
Licensed User
Well, I have tried to disable the library [B4X][B4XLib] B4XCheckInternetLM, I have compiled and it does not give error. I have included it again in the project and the error returns.

I don't know if the problem is caused by it or if it is caused by using too many libraries in the project. I have tried to add 3 or 4 more libraries not used in the project and the error does not appear.

I have added for example the xGraph library and the error returns... It seems to be some kind of limitation in the reference to certain libraries...

Rubén
 
Last edited:
Upvote 0

Rubsanpe

Active Member
Licensed User
Ok thank you. I will try it. If I see any possible new hints I will let you know. At the moment by removing those libraries the problem has disappeared.

Rubén
 
Upvote 0
Top