AppCompatDelegate: Failed with appcompat-v7:28.0.0 - android

I did a build on an android with Android Studio, everything was fine, but at some point everything broke down - and an error began to take off on absolutely all devices - I try 3 devices. Application crash on start! I did not change the build.grandle and also did not touch the code associated with it.
Perhaps this is due to the update of some libraries on the server or something?
AppCompatDelegate: Failed to instantiate custom view inflater android.support.v7.app.AppCompatViewInflater. Falling back to default.
java.lang.ClassNotFoundException: android.support.v7.app.AppCompatViewInflater
Invalidate caches and restart in Android Studio
Clean and rebuild project
Remove .grandle path and app/build path and restart android studio
AppCompatDelegate: Failed to instantiate custom view inflater android.support.v7.app.AppCompatViewInflater. Falling back to default.
java.lang.ClassNotFoundException: android.support.v7.app.AppCompatViewInflater
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.app.AppCompatViewInflater" on path: DexPathList[[zip file "/system/framework/com.android.media.remotedisplay.jar", zip file "/system/framework/com.android.location.provider.jar", zip file "/data/app/com.google.android.gms- gDUN2dwT1uff5iEdzncEiQ==/base.apk"],nativeLibraryDirectories= [/data/app/com.google.android.gms-gDUN2dwT1uff5iEdzncEiQ==/lib/arm64, /data/app/com.google.android.gms- gDUN2dwT1uff5iEdzncEiQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
:Full logcat error
I want do working build without crash

Related

Nondeterministic class loading problem in jar library of android cordova plugin

I am developing an Android Cordova plugin with local JAR libraries.
The JAR libraries are copied by Cordova into my app/libs folder (following the answer to this question: How do I properly include an external jar file for a cordova plugin?)
The Cordova app builds and runs but one class (ContextFactory), which is present in a local JAR file, fails to load:
java.io.IOException: Can't read Device Description(Provider ae.com.sun.xml.bind.v2.ContextFactory
not found / Cause: java.lang.ClassNotFoundException: Didn't find class
"ae.com.sun.xml.bind.v2.ContextFactory" on path: DexPathList[[directory
"."],nativeLibraryDirectories=[/system/lib, /system/vendor/lib, /system/lib, /system/vendor/lib]]
At first, I had the plugin run in the standard WebCore thread. After switching to a seperate thread (via cordova.getThreadPool().execute()) the class sometimes loads (non-deterministically) but only when I debug with several break points active.
By debugging into the relevant place (java.lang.ClassLoader), the AndroidStudio debugger informs me that the classLoader is
dalvik.system.PathClassLoader[DexPathList[[directory "."],nativeLibraryDirectories=[/system/lib, /system/vendor/lib, /system/lib, /system/vendor/lib]]]
More specifically, in the AndroidStudio-decompiled bytecode of (java.lang.ClassLoader from SDK Android 29), the method call
url = findResource(name); (line 793) finds a resource non-deterministically. If url remains null, the exception will be thrown, if a url is found, the class loads successfully. (url in the good case evaluates to jar:file:/data/app/name.of.my.app-1/base.apk!/META-INF/services/ae.javax.xml.bind.JAXBContext where ae.javax.xml.bind.JAXBContext is another class in the JAR file)
I assume that the "." directory refers to /app/ and so I wonder if I have to configure my project to include /app/libs/ somehow as well. If so, how can I do that?
Apparently, the library can be loaded if I run the plugin on the UI thread. cordova.getActivity().runOnUiThread()

How to fix React Native app error in Android Studio?

I have the following error when I try to run my React Native app in Android Studio.
When running the application, it tries to start, but fails and displays the following error.
07/26 15:05:47: Launching 'app' on Pixel 3 API R.
$ adb shell am start -n "com.recetasdemiyaya/com.recetasdemiyaya.SplashActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 6259 on device 'Pixel_3_API_R [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/recetasdemiyay: Not late-enabling -Xcheck:jni (already on)
I/recetasdemiyay: Unquickening 13 vdex files!
W/recetasdemiyay: Unexpected CPU variant for X86 using defaults: x86
I/recetasdemiyay: The ClassLoaderContext is a special shared library.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
No Network Security Config specified, using platform default
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.recetasdemiyaya, PID: 6259
java.lang.RuntimeException: Unable to instantiate application com.recetasdemiyaya.MainApplication: java.lang.ClassNotFoundException: Didn't find class "com.recetasdemiyaya.MainApplication" on path: DexPathList[[zip file "/data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/base.apk"],nativeLibraryDirectories=[/data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/lib/x86, /data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/base.apk!/lib/x86, /system/lib, /system_ext/lib, /product/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:1211)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6521)
at android.app.ActivityThread.access$1300(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1885)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7464)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.recetasdemiyaya.MainApplication" on path: DexPathList[[zip file "/data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/base.apk"],nativeLibraryDirectories=[/data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/lib/x86, /data/app/~~CE-MOv3Jm55BXMcdUPlUeg==/com.recetasdemiyaya-889WixNrp2DNabkeMOGRLA==/base.apk!/lib/x86, /system/lib, /system_ext/lib, /product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:202)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:76)
at androidx.core.app.CoreComponentFactory.instantiateApplication(CoreComponentFactory.java:49)
at android.app.Instrumentation.newApplication(Instrumentation.java:1158)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1203)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6521) 
at android.app.ActivityThread.access$1300(ActivityThread.java:229) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1885) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:216) 
at android.app.ActivityThread.main(ActivityThread.java:7464) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955) 
In the EVENT LOG section, it shows me the following error:
Unsupported Modules Detected: Compilation is not supported for
following modules: lottie-react-native, react-native-admob,
android-react-native-fbsdk, android-react-native-onesignal,
android-react-native-fast-image, android-react-native-blur,
android-react-native-webview, android-react-native-vector-icons,
android-react-native-gesture-handler,
android-react-native-linear-gradient, android-react-native-admob,
android-lottie-react-native, react-native-blur, react-native-fbsdk,
react-native-onesignal, react-native-gesture-handler,
react-native-vector-icons, react-native-linear-gradient,
react-native-fast-image, react-native-webview. Unfortunately you can't
have non-Gradle Java modules and Android-Gradle modules in one project
.
When I try to run the application in the terminal from the root of my project, with the react-native run-android command, the application shows for an instant, but it doesn't start working, but it doesn't show me errors.
However, when I run the react-native run-ios command the application works perfectly in my simulator.
My experience is little and my command of English is also little, so I do not know where to go and where to look within my project to correct the errors that Android Studio shows me.
I have updated Android Studio, as I have read similar problems before coming to ask, but I don't know how to eliminate LA CACHES / RESTART => INVALIDATE CACHES & RESTART, which I have seen in another question
What should I do for Invalidate Caches?
I'm still looking for a solution, but I can't find a way, I keep looking at other questions, but I think I'm not looking correctly, and that's why I'm here.
Can you help me ?
Thank you
1- close the project
2- close Android Studio IDE
3- delete the .idea directory
4- delete all .iml files
5- open Android Studio IDE and import the project
if issue still exist copy project to other location and open it again in Android studio.
Cleaning gradlew works for me
cd android && ./gradlew clean && cd ..

Class not found at run time though it's in apk file

I'm trying to run a program on the phone from android studio. It tries to send an email using javax.mail. When running under the debugger, see these errors in the debug console.
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/sun/mail/util/MailLogger;
at javax.mail.Session.initLogger(Session.java:261)
at javax.mail.Session.<init>(Session.java:245)
at javax.mail.Session.getDefaultInstance(Session.java:356)
at com.example.sendemail.GMailSender.<init>(GMailSender.java:53)
...
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.sun.mail.util.MailLogger" on path: DexPathList[...]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at javax.mail.Session.initLogger(Session.java:261) 
...
The class com/sun/mail/util/MailLogger is present in the apk. Found this from 'Analyze APK' (image below). It's in classes.dex. Why isn't it found at run time?
Android Studio version 3.4.1
Android version on phone is 7.0

Android Studio - App won't open in emulator for an unmodified Basic App template

I just installed Android Studio and have started a new app (Basic App template with toolbar and floating button). I have enabled Virtualization in my BIOS and have added a Pixel 2 (version 29) emulator.
When I press the Run button, the emulator opens the Pixel 2 and powers on, but the app doesn't open and no icons appear (apart from the standard phone, sms, chrome, playstore icons). I press Run again and still nothing happens (apart from Gradle building).
There are no errors that I can see.
Edit: Every now and then when I press Run I see the following error message in Event Log:
8:52 AM Error during Sync: Remote object doesn't exist!
This only occurs sometimes. Other time, it just says:
8:44 AM Executing tasks: [:app:assembleDebug]
8:44 AM Gradle build finished in 3 s 972 ms
I have tried:
Deleting the emulator from AVD Manager then creating a new one (Pixel 2, version 29, everything else left as default).
Deleting the project and creating a new one
Uninstalling and reinstalling Android Studio
Restarting computer
Going to File > Invalidate Caches / Restart and invaliding then restarting
Edit 2:
I was just asked to check Logcat in a comment. There is a lot in there but this part is highlighted red and repeats throughout the logs:
2019-08-02 08:53:21.707 2031-9184/? E/LoadManifestTask: Can't find Chimera operation impl class com.google.android.gms.walletp2p.infra.phenotype.PhenotypeCommitIntentOperation dropping operation
java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.walletp2p.infra.phenotype.PhenotypeCommitIntentOperation" on path: DexPathList[[zip file "/system/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_extracted_libs/x86, /system/product/priv-app/PrebuiltGmsCore/lib/x86, /system/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/x86, /system/lib, /system/product/lib, /system/lib, /system/product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at ecj.<init>(:com.google.android.gms#16910022#16.9.10 (040700-247503114):5)
at eck.run(:com.google.android.gms#16910022#16.9.10 (040700-247503114):53)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
This is a very undesirable kind of system bug. Well, the point is here that, sometimes even creating a simple data directory won't work. You would have to go to the source and create a folder yourself. This case is same. Attempting 'Invalidate caches and restating' isn't working, so you have to do it manually. This is how:
Solution:
Close Android Studio
Go to C:\Users\UserName\.android and rename:
build-cache folder to build-cache.bak
Go to C:\Users\UserName\.AndroidStudio3.4.2\system and rename these folders:
caches to caches.bak
compiler to compiler.bak
compile-server to compile-server.bak
conversion to conversion.bak
external_build_system to external_build_system.bak
frameworks to frameworks.bak
gradle to gradle.bak
resource_folder_cache to resource_folder_cache.bak
Open the Android Studio and open your project again.
Hope it solves your case also. Did for me when I faced the same problem around a year ago.

CoreComponentFactoryDidn't find class "android.support.v4.app.CoreComponentFactory"

I got sudden crash in my google pixel 2 having android 9 version.
Is there any hint what is the reason behind that and it is not reproducible every time.
detail logs...
Didn't find class "android.support.v4.app.CoreComponentFactory" on
path: DexPathList[[zip file
"/data/app/com.google.android.deskclock-o_Iury9TRKVebStZjRrd0g==/base.apk"],nativeLibraryDirectories=[/data/app/com.google.android.deskclock-o_Iury9TRKVebStZjRrd0g==/lib/arm64,
/system/lib64]]
Just clean the build and run it will go away

Categories

Resources