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.
Related
looking for ideas to fix instant app on Android 12+
Tried everything could find in docs and on StackOverFlow
Manifest declaration is fine. .well-known/assetlinks.json is good, same as in Google Play Developer console.
The instant app is working fine on Android <12.
When running:
adb shell pm verify-app-links --re-verify mypackagename
Logcat shows:
AppLinksIntentOperation com.google.android.gms I Verifying requested domains [CONTEXT service_id=244 ]
AppLinksRequestHandler com.google.android.gms I Processing 1 input requests [CONTEXT service_id=244 ]
AppLinksUtilsV1 com.google.android.gms I Legacy cross-profile verification enabled [CONTEXT service_id=244 ]
AppLinksHostsVerifierV2 com.google.android.gms E Could not find package to verify: my.package.name [CONTEXT service_id=244 ]
android.content.pm.PackageManager$NameNotFoundException: my.package.name
at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:293)
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:265)
at bwkk.e(:com.google.android.gms#224814044#22.48.14 (190400-493411920):5)
at bwkk.d(:com.google.android.gms#224814044#22.48.14 (190400-493411920):2)
at bwke.c(:com.google.android.gms#224814044#22.48.14 (190400-493411920):2)
at bwke.b(:com.google.android.gms#224814044#22.48.14 (190400-493411920):0)
at com.google.android.gms.statementservice.DomainVerificationIntentOperation.onHandleIntent(:com.google.android.gms#224814044#22.48.14 (190400-493411920):12)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms#224814044#22.48.14 (190400-493411920):2)
at xsd.onHandleIntent(:com.google.android.gms#224814044#22.48.14 (190400-493411920):4)
at gua.run(:com.google.android.gms#224814044#22.48.14 (190400-493411920):3)
at gtz.run(:com.google.android.gms#224814044#22.48.14 (190400-493411920):11)
at cwng.run(:com.google.android.gms#224814044#22.48.14 (190400-493411920):2)
Instant app is installed and can be located through the Settings -> Apps -> MyPackageName
Any ideas are welcome
I have an apk that installs fine on all my devices except on an old Samsung Galaxy J5 (and on a Huawei Y3).
I had copy the APK on the device via USB and try to install it with the "my files" app. The log is as follows:
02-08 11:36:56.226 1647-1674/? D/ActivityManager: Launching com.google.android.packageinstaller, updated priority
02-08 11:36:56.226 1647-1647/? D/GameManagerService: NotifyRunnable. pkg: com.google.android.packageinstaller, type: 4, isMinimized: false, isTunableApp: false
02-08 11:36:56.226 1647-1647/? D/GameManagerService: unexpected mPrevNotiType: -1
02-08 11:36:56.246 1647-1836/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:843 com.android.server.policy.PhoneWindowManager.notifyToSSRM:9071 com.android.server.policy.PhoneWindowManager.access$2100:330 com.android.server.policy.PhoneWindowManager$PolicyHandler.handleMessage:1268 android.os.Handler.dispatchMessage:102
02-08 11:36:56.246 19954-19954/? W/PackageInstaller: Parse error when parsing manifest. Discontinuing installation
Did anybody come across something like that as well?
I´ve checked the option that I can install APK from unknown sources so that can´t be the problem. And I´ve tried to install it from SD-card or internal memory with no success.
If somebody comes around the same problem. I was able to fix it by not using the signing function in Androidstudio but by manually using jarsigner and zipalign from java and the android-sdk-tools.
My Delphi project have both android 32 and 64 destination. I can deploy them on my test devices and they both works fine.
Now google forces me to upload a single app bundle file (.aab), so i flagged the "Generate Android App Bundle file (arm + arm64)" option, set up my provisioning keystore, loaded the alias and then generated that .aab file
I uploaded that as a beta release for my app from the android developer portal and after a few hours it became available to download for my test devices. But.. it shows the start up logo.. and nothing else.
I don't really know how to debug this since both the apks are working fine (32 and 64 bit), so i tried to launch adb logcat *:W, but i still cannot get useful info. I got those lines in endless loop:
10-30 09:59:21.656 13723 13723 E systems.<my app name>: Not starting debugger since process cannot load the jdwp agent.
10-30 09:59:21.688 13723 13723 W systems.<my app name>: JIT profile information will not be recorded: profile file does not exits.
10-30 09:59:21.688 13723 13723 W systems.<my app name>: JIT profile information will not be recorded: profile file does not exits.
10-30 09:59:21.703 922 1100 E ANDR-IOP: IIop:: Iop HAL Service is not available.
10-30 09:59:21.707 13723 13743 E Perf : Fail to get file list oat
10-30 09:59:21.707 13723 13743 E Perf : getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
10-30 09:59:21.743 13723 13723 W linker : Warning: "/data/app/<my app name>-43xRWdYLtXcvUAbEkuUk6g==/split_config.arm64_v8a.apk!/lib/arm64-v8a/lib<my app name>.so" unused DT entry: DT_RPATH (type 0xf arg 0x2cf24) (ignoring)
Just for info: getFolderSize() is not a function i use in my code (its not even declared).
Also, i think this is pretty important: my app deploys some .so files (different files for 32 and 64 bit) and some other files, like images and fonts.
Why i think this is important? Just a suspect born reading this similar issue (but with xamarin): https://github.com/xamarin/Xamarin.Forms/issues/11450
I also tried to deploy the .aab manually on my devices but the only thing i found is how to generate the .apks file from the .aab, and i still cannot deploy it on my devices.
I'm using Delphi 10.4.1 and i also tried to recreate the .dproj file setting up everything again.
How i can debug this? Or how i can get more info about the cause?
Edit: Solved it! I had a few problems that, mixed together, caused this; i'll try to list them in case someone will have a similar issue and will end here!
my androidmanifest.template.xml file was generated by an older version of delphi and was missing some important parts
you need to include all the needed .so files in both 32 and 64bit build to actually have them in the bundle
using TPath.GetLibraryPath() when loading .so files can produce different results if you are using it inside a .aab bundle package
i was trying to load one of those .so file from the initialization section using the function TPath.GetLibraryPath() to get the root path, that was causing a unhandled exception that make my app crash into the splash screen
I solved simply removing TPath.GetLibraryPath() from the path i was using to load my .so and now it works
We are trying to debug an APK using Android studio and are coming up with the following errors. We tried launching it but cannot pass the initial signing screen without it receiving the following errors before the app restarts itself. Please help in fixing the exception.
Device being used: 1+ Pro
Logcat Message :
I/Adreno: QUALCOMM build : 3bc9a6f, I21de9e011e
Build Date : 02/25/19
OpenGL ES Shader Compiler Version: EV031.25.19.01
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.7.1.R1.09.00.00.461.091
Remote Branch : NONE
Reconstruct Branch : NOTHING
Build Config : S P 6.0.9 AArch64
.....
E/AppCenter: Distribute needs to be started before it can be used.
E/libc: Access denied finding property "persist.vendor.hwui.skia.multithread.enabled"
Access denied finding property "persist.vendor.hwui.skia.reduce.overdraw.enabled"
E/Application: ProcessId: 14561, Thread: Pool-WorkManager-Thread-1, EXCEPTION - DB access is requested even when user has either not authenticated yet or has been sign out.
I have a unity project for android which is larger than 50MB and so must be split. I have had working apt splitting for a couple months now. Starting a few days ago I mad a couple changes which were purely aesthetic. I uploaded the new build and now(days after the api and obb files were uploaded) I receive an error at the download point on the device "Download failed because the resources could not be found."
I manually added the obb file to the device and it worked, I have tried re uploading the apk and bob files with minor changes and still after a day of waiting see the same errors.
viewing with logcat I see these errors when i try to download
I/LicenseChecker(20270): Binding to licensing service.
W/ContextImpl(20270): Implicit intents with startService are not safe: Intent { act=com.android.vending.licensing.ILicensingService } android.content.ContextWrapper.bindService:517 com.unity3d.plugin.downloader.c.j.a:-1 com.unity3d.plugin.downloader.b.s.run:-1
I/LicenseChecker(20270): Calling checkLicense on service for [my project com]
I/LicenseChecker(20270): Start monitoring timeout.
W/GLSUser (26959): GoogleAccountDataService.getToken()
I/qtaguid (18936): Failed write_ctrl(u 53) res=-1 errno=22
I/qtaguid (18936): Untagging socket 53 failed errno=-22
W/NetworkManagementSocketTagger(18936): untagSocket(53) failed with errno -22
I/ElegantRequestDirector(18936): I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
I/ElegantRequestDirector(18936): Retrying request
I/LicenseChecker(20270): Received response.
I/LicenseChecker(20270): Clearing timeout.
Its not obvious to me what I did to make obb downloading stop working. I don't know enough about the error messages to pick anything out of it.
What can I do to make it download the bob files again?
In case anyone else runs into this here was my solution. It looks like Google made a policy change.
"To test your application's implementation of the manual download procedure, you can publish it to the alpha or beta channel, so it will only be available to authorized testers. If everything works as expected, your application should begin downloading the expansion files as soon as the main activity starts.
Note: Previously you could test an app by uploading an unpublished "draft" version. This functionality is no longer supported; instead, you must publish it to the alpha or beta distribution channel. For more information, see Draft Apps are No Longer Supported."
so now you need to publish your alpha/beta builds before you can download the files.