Android Question v10.7: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/arch/core/executor/ArchTaskExecutor;

Edson Freire

Member
Licensed User
After I've updated my IDE to V10.7 and compiled my application, I couldn't open it anymore.
I'm getting the following error in log:


Process: package.Name, PID: 29055
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/arch/core/executor/ArchTaskExecutor;
at androidx.lifecycle.LifecycleRegistry.enforceMainThreadIfNeeded(LifecycleRegistry.java:316)
at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:172)
at androidx.activity.ComponentActivity.<init>(ComponentActivity.java:224)
at androidx.fragment.app.FragmentActivity.<init>(FragmentActivity.java:103)
at androidx.appcompat.app.AppCompatActivity.<init>(AppCompatActivity.java:87)
at package.Name.main.<init>(main.java:18)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1606)
at android.app.Instrumentation.newActivity(Instrumentation.java:1066)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2226)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.arch.core.executor.ArchTaskExecutor" on path: DexPathList[[zip file "/data/app/package.Name-3/base.apk"],nativeLibraryDirectories=[/data/app/package.Name-3/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 20 more
Suppressed: java.lang.ClassNotFoundException: androidx.arch.core.executor.ArchTaskExecutor
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 21 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
Force finishing activity 1 package.Name/.main


After getting this error, I've tried to compile in a older IDE version (V8.80). And now, I'm getting the following error in compilation:

...\Objects\bin\extra\res10\res\values\values.xml:3: error: Found tag id where item is expected
...\Objects\bin\extra\res9\res\values\values.xml:3: error: Found tag id where item is expected
...\Objects\bin\extra\res7\res\values\values.xml:3: error: Found tag id where item is expected
...\Objects\bin\extra\res3\res\values\values.xml:36: error: Attribute "fontProviderFetchStrategy" already defined with incompatible format.
...\Objects\bin\extra\res6\res\values\values.xml:127: Original attribute defined here.
...\Objects\bin\extra\res3\res\values\values.xml:51: error: Attribute "fontProviderFetchTimeout" already defined with incompatible format.
...\Objects\bin\extra\res6\res\values\values.xml:139: Original attribute defined here.
...\Objects\bin\extra\res3\res\values\values.xml:61: error: Attribute "fontStyle" already defined with incompatible format.
...\Objects\bin\extra\res6\res\values\values.xml:147: Original attribute defined here.


I've updated my SDK as well. I tried version 30 of the API and all the others I have here.
 

Erel

B4X founder
Staff member
Licensed User
After getting this error, I've tried to compile in a older IDE version (V8.80). And now, I'm getting the following error in compilation:
Don't worry. This one is easily fixed.

Which libraries are you using?

I recommend you to download the two components of the SDK, in a new folder and configure the IDE to use it: https://www.b4x.com/b4a.html
 
Upvote 0

Edson Freire

Member
Licensed User
Which libraries are you using?
I'm using 48 libraries. Some of them was made by myself (using SLC):
B4X:
accessibility
core
dialogs
downloadmanager
downloadprogress
encryption
ezcamera
gameview
http
httputils2
ime
animation
javaobject
jhsicezxing1
joeimgs
json
maskededittext
mlwifi
mobilevision
msmaterialdrawer
net
phone
appcompat
progresswheel
randomaccessfile
reflection
runtimepermissions
scrollview2d
serial
simcard
sql
sqlcipher
stringfunctions
archiver
stringutils
sunmi
threading
viewsex
websocket
xmlsax
xui
zbarbarcodescanner
gONE framework g700
base64image
bitmapplus
byteconverter
camera
camera2

I recommend you to download the two components of the SDK, in a new folder and configure the IDE to use it: https://www.b4x.com/b4a.html
Ok, I'll try. But I don't remember exactly everything that I had installed before.
 
Upvote 0

Edson Freire

Member
Licensed User
I recommend you to download the two components of the SDK, in a new folder and configure the IDE to use it: https://www.b4x.com/b4a.html

I redid the whole process with the SDK and I continue to have the same error. All of this happened because I wanted to update the IDE, now I can't compile the project anymore ...

...\Objects\bin\extra\res10\res\values\values.xml:3: error: Found tag id where item is expected
...\Objects\bin\extra\res9\res\values\values.xml:3: error: Found tag id where item is expected
...\Objects\bin\extra\res7\res\values\values.xml:3: error: Found tag id where item is expected
...\Objects\bin\extra\res3\res\values\values.xml:36: error: Attribute "fontProviderFetchStrategy" already defined with incompatible format.
...\Objects\bin\extra\res6\res\values\values.xml:127: Original attribute defined here.
...\Objects\bin\extra\res3\res\values\values.xml:51: error: Attribute "fontProviderFetchTimeout" already defined with incompatible format.
...\Objects\bin\extra\res6\res\values\values.xml:139: Original attribute defined here.
...\Objects\bin\extra\res3\res\values\values.xml:61: error: Attribute "fontStyle" already defined with incompatible format.
...\Objects\bin\extra\res6\res\values\values.xml:147: Original attribute defined here.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
When I open B4ASdkManager.jar and select the sdkmanager.bat, I'm getting an error.
1. You don't need to run sdk manager at all. Just download the two components.
2. The "found tag id" will not happen with the correctly configured SDK and also will not happen with B4A v10.7

Delete your current SDK and download the two components. Make sure to unzip them with 7zip.
 
Upvote 0

sadeq.hitex

Member
Licensed User
Check (Sdk Manager) to make sure it is installed
1616874906055.png

Then just add this line to fix the problem
B4X:
#AdditionalJar: androidx.arch.core:core-runtime
 
Upvote 0
Top