I use the Android studio 2.0, and configure the project with the official doc , the config of instant run in the setting window of AS has changed from disabled to enabled state. As well the run icon has lightning now,but when i change the code, just add a toast in a function, and click the lightning run, the application will be exit, and log show like below:
11-24 19:59:40.382 20951-20957/com.ss.android.essay.joke I/art: System.exit called, status: 1
11-24 19:59:40.383 20951-20957/com.xxx I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
11-24 19:59:40.475 4922-14521/? I/WindowState: WIN DEATH: Window{651bd86 u0 com.ss.android.essay.joke/com.xxx.MainActivity}
Edit:The status of bug has updated,crash not happened again with alpha2,but still can't use instant-run, more detail:https://code.google.com/p/android/issues/detail?id=195064
Edit: Android studio 2.1.1 with 2.12 gradle work well now.
Pretty sure your change is not covered by Instant Run, check out Android tools site for a list of supported hot swap actions:
Related
Bug description:
The first time I open my app the website loads correctly in the WebView. Then I go to the homescreen and after a while I return to the app and gets the following error:
Website not available
The website at https://www.example.com?param=value could not be loaded because:
net::ERR_FAILED
Has anyone seen this error before?
Here is some logs from Android Studio that may or my not be related/useful.
2019-06-24 10:59:11.233 16101-16166/? W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true
2019-06-24 10:59:11.237 16101-16101/? I/cr_BrowserStartup: Initializing chromium process, singleProcess=false
2019-06-24 10:59:11.239 16101-16101/? W/ResourceType: Failure getting entry for 0x7f130537 (t=18 e=1335) (error -2147483647)
2019-06-24 10:59:11.241 16169-16169/? E//system/bin/webview_zygote32: failed to make and chown /acct/uid_99051: Permission denied
2019-06-24 10:59:11.241 16169-16169/? E/Zygote: createProcessGroup(99051, 0) failed: Permission denied
2019-06-24 10:59:11.244 16169-16169/? W//system/bin/webview_zygote32: Using default instruction set features for ARM CPU variant (cortex-a9) using conservative defaults
2019-06-24 10:59:11.248 1700-6616/? I/ActivityManager: Start proc 16169:com.android.chrome:sandboxed_process0/u0i51 for webview_service dk.MYAPPNAME.app/org.chromium.content.app.SandboxedProcessService0
2019-06-24 10:59:11.264 1991-1991/? I/chatty: uid=10016(u0_a16) com.android.systemui identical 1 line
2019-06-24 10:59:11.265 16169-16169/? I/SamplingProfilerIntegration: Profiling disabled.
2019-06-24 10:59:11.289 16197-16197/? E/asset: setgid: Operation not permitted
To Reproduce:
I have only been able to reproduce this error in release - not in debug. This error happens after loading the app the first time, then leaving it and return to the app after a few hours.
Maybe it is related to cache.
The problem persist when I force quit the app. If I reinstall the app it is working for a while.
Expected behavior:
Website should fully load.
Screenshots/Videos:
Environment:
- OS: Android (Huawei P20 Pro and multiple other Android phones)
- OS version: Android 8
- react-native version: 59.3
- react-native-webview version: 5.6.2
I found a fix for this issue!
It looks like a broken service worker stalled the website.
I solved it by using the injectedJavascript prop in my WebView to inject the following lines of code:
navigator.serviceWorker.getRegistrations().then(function(registrations) {
for (let registration of registrations) {
registration.unregister();
}
});
It is a bug in Google Chrome 75.
I have a Xamarin.Forms app built for iOS and Android. The application works fine when tested from Visual Studio (in Debug or Release modes and on the emulator or a device). However, when I try to deploy it through AppCenter, the app works on iOS and on Android, it displays the SplashScreen and then a blank white page. None of my controls show up at all...on iOS it is working fine, so the Views seem to be correct..
I hooked up the Android Device Monitor, but I do not seem to get any error messages. I have tried several changes of the project properties (turning ProGuard and MultiDex on and off; changing the Linker settings), but nothing seems to change the behavior.
I am out of ideas to even look for the problem...does anyone have any suggestions? Has anyone seen this before? Is there anywhere that lists the differences in build between Visual Studio and AppCenter?
UPDATE: I have gotten some additional logging from the Device Monitor. There are additional log entries in the version that works, so it seems that something is not running in the deployed version (maybe associated with Google Maps?).
The version not working has these two lines:
01-09 07:23:04.378: I/Google Maps Android API(11219): Google Play services client version: 11400000
01-09 07:23:04.709: I/LaunchCheckinHandler(1410): Displayed {my application name}/md582f1e314fc580d8ae4e7bb0d59c62d55.MainActivity,wp,ca,537
The version that works has these extra log entries:
01-09 07:28:29.970: I/Google Maps Android API(12443): Google Play services client version: 11400000
01-09 07:28:31.807: I/SFPerfTracer(735): triggers: (rate: 0:0) (9563 sw vsyncs) (0 skipped) (121:40138 vsyncs) (123:54057)
01-09 07:28:32.279: I/SFPerfTracer(735): triggers: (rate: 6:1097) (compose: 0:0) (post: 0:3) (render: 0:4) (125:27407 frames) (126:32007)
01-09 07:28:32.279: D/SFPerfTracer(735): layers: (2:8) (StatusBar#0 (0xaf154000): 4:4927)* (com.android.systemui.ImageWallpaper#0 (0xaf113000): 0:228)* (DimLayerController/Stack=0#0 (0xaf10c000): 0:373)* (animation background stackId=1#0 (0xaf192000): 0:20)* (NavigationBar#0 (0xaf445000): 0:493) (com.android.launcher3/com.android.launcher3.CustomizationPanelLauncher#0 (0xaf424000): 0:14)* (com.android.launcher3/com.android.launcher3.CustomizationPanelLauncher#1 (0xaf2fa000): 0:154)* ({my application name}/md582f1e314fc580d8ae4e7bb0d59c62d55.SplashActivity#0 (0xaf437000): 0:3)
01-09 07:28:32.514: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md58432a647068b097f9637064b8985a5e0.ViewRenderer_2
01-09 07:28:32.652: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.ActivityIndicatorRenderer
01-09 07:28:32.764: I/ThermalEngine(967): Thermal-Server: Thermal received msg from override
01-09 07:28:32.764: I/Thermal-Lib(721): Thermal-Lib-Client: Client request sent
01-09 07:28:32.947: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.TableViewRenderer
01-09 07:28:33.055: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.BaseCellView
01-09 07:28:33.055: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.TextCellRenderer_TextCellView
01-09 07:28:33.083: W/zygote(12443): JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.CellRenderer_RendererHolder
01-09 07:28:33.172: W/View(12443): requestLayout() improperly called by md51558244f76c53b6aeda52c8a337f2c37.ScrollViewContainer{3f9ae0f V.E...... ......ID 0,0-1080,1444} during layout: running second layout pass**
01-09 07:28:33.325: I/LaunchCheckinHandler(1410): Displayed {my application name}/md582f1e314fc580d8ae4e7bb0d59c62d55.MainActivity,wp,ca,3558
Can anyone translate these log messages into English so I have some idea where to look for the issue? IS there something extra that needs to be done with Google Maps when it is deployed versus debug/testing?
Thanks in advance.
It may not relate to the OP's issue but I had the same symptom today:
App working fine on Android when deployed from VS.
Blank screen when deployed from the MDM provider (in my case this was Airwatch Workspace ONE).
No useful information provided in the logs and no errors occurred.
I fixed it by unchecking Android Options -> Use shared runtime
I have suddenly hit a wall with testing my Xamarin.Forms app. IT has suddenly started throwing the two messages below and failing (on my Android Emulator) immediately after the splash screen disappears.
I get the following warning during the build:
Ignoring C:\Users\geral\.nuget\packages\system.security.cryptography.cng\4.3.0\ref\netstandard1.6\System.Security.Cryptography.Cng.dll as it is a Reference Assembly
And then the Output windows shows these message when the app fails:
11-18 09:33:29.257 D/Mono (31723): Assembly Ref addref Xamarin.GooglePlayServices.Tasks[0xe1503180] -> Mono.Android[0xe15031e0]: 26
11-18 09:33:29.260 D/Mono (31723): Assembly Loader probing location: 'System.Security.Cryptography.Cng'.
11-18 09:33:29.260 F/monodroid-assembly(31723): Could not load assembly 'System.Security.Cryptography.Cng' during startup registration.
11-18 09:33:29.260 F/monodroid-assembly(31723): This might be due to an invalid debug installation.
11-18 09:33:29.260 F/monodroid-assembly(31723): A common cause is to 'adb install' the app directly instead of doing from the IDE.
In searching the web, I found a few articles that seemed related but nothing fixes the error. I have updated all NuGet packages and the Android SDK to the latest available. I am out of ideas.
https://forums.xamarin.com/discussion/63584/android-could-not-load-assembly-xxx-during-startup-registration
https://forums.xamarin.com/discussion/42405/debug-deployment-to-device-works-fine-release-fails-with-odd-messages-anybody-have-a-fix-for-this
Anyone have additional suggestions?
The actual answer was a little obvious after I had some time to come back to it. I added the NuGet package directly to my projects and now things are working correctly again. I had assumed the Reference would be sufficient, but in this case a direct reference was apparently needed. Still not sure why, or what changed that made it suddenly become a problem.
But if you get these message in the future try adding the package directly.
I was testing my app and I saw it restart itself, was really weird. I looked and looked on the logs and I couldn't find anything odd except for this line ChimeraModuleLdr: Module config changed, forcing restart due to module. This is on a Pixel XL with Oreo.
Here are the last few lines of the log and the start up of the app after it was killed.
10-18 22:49:31.262 8379 8379 I ChimeraModuleLdr: Module config changed, forcing restart due to module
10-18 22:49:31.262 8379 8379 I Process : Sending signal. PID: 8379 SIG: 9
--------- beginning of main
10-18 22:49:31.641 13717 13717 I MultiDex: VM with version 2.1.0 has multidex support
10-18 22:49:31.641 13717 13717 I MultiDex: install
10-18 22:49:31.641 13717 13717 I MultiDex: VM has multidex support, MultiDex support library is disabled.
Any idea about what triggered this?
It seems that the ChimeraModule (or Dynamite) is the dynamic module loading system used by the Google Play Services (more details here).
I guess that, if your app is using a specific module from the Google Play Services, when that specific module is updated your app is restarted as well.
Adding to what #bonnyz already said, I fixed it by removing all references to the libraries updated by the module, in my case the android vision library.
Adding further,
In context of Xamarin Forms project, the error you describe was caused by the Xamarin.Forms.GoogleMaps V4 package. reverting to V3.x.x solved the problem for me.
After starting to use Android Studio 2.0, when I open old projects first time executing "Run App" crashes app on Android device but when I comment out every code on MainActivity I can "Run App" without problem, then I just uncomment lines I've already commented and "Run App" again and it works flawlessly too...
So I need to do that three step after a while but as I said I only comment and uncomment code blocks, so eventually code that did not work at first time starts to run and I looked for logs before and after doing these, and before commenting there is only two log lines and then no output occurs in logcat
09-29 23:42:15.248 8328-8328/sparkgoattendance.bsobe.com.attendance I/art: Late-enabling -Xcheck:jni
09-29 23:42:15.439 8328-8328/sparkgoattendance.bsobe.com.attendance W/System: ClassLoader referenced unknown path: /data/app/sparkgoattendance.bsobe.com.attendance-1/lib/arm
and I get these log lines in logcat at top after doing commenting uncommenting thing, so I don't know if it is related to my problem.
I suspect it is a problem about ART and wait for your help, thank you
In Run/Debug Configuration, there is Miscellaneous tab. There is an option called Skip installation if APK has not changed. Uncheck that option.
It sounds like APK already existed and for some reason,it just installed that APK from before. If you uncheck it, it will create a new one each time. This is why when you commented and uncommented the code, it worked. Because it created a new APK.