Code generator has deoptimised the styling in react-native - android

I am getting this after my react native build is successful :
transform[stderr]: [BABEL] Note: The code generator has deoptimised
the styling of /Users/myName/Desktop/mool_mobile/unknown as it exceeds
the max of 500KB.
In the emulator the splash screen shows up for 1 minute or so and then it eventually crashes. Couldn't find much resources regarding this issue.
Thanks in advance.

As it says in this Response:
It's just a warning (not an error) that can be safely ignored.
However, if you want to silence it, you might try to set the https://babeljs.io/docs/en/options#compact option to true
Response link: https://github.com/babel/babel/discussions/13676#discussioncomment-1183149

Related

Failed to Deploy Android Xamarin Forms Application After Adding Splash Screen

For a couple days I tied to implement the splash screen on Android Xamarin Forms Application, I tied many approaches but all failed in the same way,
The application before adding the splash screen is working fine,
After adding the splash screen i get this error message
3>------ Deploy started: Project: NoorAlEman.Android, Configuration: Debug Any CPU ------
3>Error: Cancelled
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
sometime the application run without showing the splash screen for one time only if i delete "bin" and "obj" folder and rebuild the solution and most of other time it keeps showing the same error message.
I am sure about adding all files using visual studio 2019 interface, also all files have
Build Action: AndroidResource
Copy to output directory: Do not copy "Also i tried to make it as copy always"
Custom tools: I tried to leave it empty and other times i set to "MSBuild:UpdateGeneratedFiles"
Other thing i done is to set the MainLauncher to false in the manactivity.cs and setting it to true in the splashsctivity.cs
I tried these tutorials and all ended up showing the same error
(1) https://learn.microsoft.com/en-us/xamarin/android/user-interface/splash-screen
(2) https://progrunning.net/best-way-to-create-a-splash-screen-in-xamarin-forms-android-project/
(3) http://ebubekirsezer.com/en/xamarin-forms-splash-screen/?unapproved=11607&moderation-hash=67d1307ecdd13ca8e5b0acceae43d22d#comment-11607
Please do you have any suggestion that might resolve this issue.
Thank you in advance
M. Mazin
What I did was to create a new activity, say SplashActivity with the following attributes [Activity(MainLauncher = true, Theme = "#style/MainTheme.Splash", NoHistory = true)], where the Theme would be an image, or whatever you want your splashscreen to be. Then inside you just start the main activity of your application, something like this:
protected override void OnResume()
{
base.OnResume();
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
}
Don't forget to remove the MainLauncher attribute from the MainActivity.
Hope it helps!
For me the only solution was:
-rebuilding the project
-closing and reopening VS
-disconnecting and reconnecting my mobile device
I don't know where this error comes from, and it's a real pain, but this way you can at least keep testing your app until there comes an update which fixes it.

"Unknown bits set in runtime_flags: 0x8000" warning in Logcat on Android Q emulator

I'm getting this warning as the first line from my app in logcat, and I have no idea what it refers to and how I should go about fixing it. Google doesn't offer much info on this (in fact, none at all). Please advise. What kind of flags might this be about? Is there a way to find out what the specified bit might refer to (or, perhaps, has been referring to on older Android versions but has become invalid in Android 10)? There is no such line in the log on Android 9 or earlier versions.
I bring a stone to the building. I retrace the code for the error message. It is at line 345 in the C ++ file dalvik_system_ZygoteHooks.cc
At a minimum, if (runtime_flags! = 0) then the error message will be printed. 0x8000 also corresponds to the USE_APP_IMAGE_STARTUP_CACHE flag (see line 157). The test on the USE_APP_IMAGE_STARTUP_CACHE flag is done on line 340. Normally, runtime_flags should no longer have a raised bit for USE_APP_IMAGE_STARTUP_CACHE but this does not seem to be the case since the error is printed.
But in the end, the error does not seem to have an impact on the application.
I searched and I have some suggestion to you.
First of all take a look at this links:
hexadecimal-0x8000
difference between constants 32768 and 0x8000
Now this links may be can help you :
Android Fragment no view found for ID
FLAG_ACTIVITY_CLEAR_TOP
addFlags(0x8000)
and last thing is:
Uninstall App from emulator and Run project Again.
First Edit:
I Searched again and i think we are close to answer, so please check this links and say what do you think? are they Irrelevant? or we are on the right way.
...
AConfiguration
org.robolectric.res.android
Class AConfiguration
ACONFIGURATION_SCREEN_ROUND
public static final int ACONFIGURATION_SCREEN_ROUND
...
\sdk\ndk-bundle\sysroot\usr\include\android
configuration.h
* Bit mask for
* layout direction
* configuration.
ACONFIGURATION_LAYOUTDIR = 0x4000,
ACONFIGURATION_SCREEN_ROUND = 0x8000
...
https://developer.android.com/ndk/reference/group/configuration
android_ndk_sys
Constant : ACONFIGURATION_SCREEN_ROUND
->
Constant android_ndk_sys::ACONFIGURATION_SCREEN_ROUND
pub const ACONFIGURATION_SCREEN_ROUND: _bindgen_ty_3
->
Type Definition android_ndk_sys::_bindgen_ty_3
type _bindgen_ty_3 = u32;
...
ACAMERA_VENDOR = 0x8000
ACAMERA_VENDOR = 0x8000
ACAMERA_DISTORTION_CORRECTION << 16,
ACAMERA_HEIC_START = ACAMERA_HEIC << 16,
ACAMERA_HEIC_INFO_START = ACAMERA_HEIC_INFO << 16,
ACAMERA_VENDOR_START = ACAMERA_VENDOR << 16
In my case at least happens because The fragment tried to update the view (or something like this) when a different activity was already running so just
#Override
public void onStop() {
super.onStop();
getActivity().finish();
}
inside the fragment solved this error
Not sure if this will help anyone else, but I found I only get this peculiar error only on an Emulator!
so maybe a bug with Emulator 🤷‍♂️ .
Anyway, I suggest testing on a real device as this is the second time this sort of issues wasting so much of my time to investigate, I won't trust the Emulators anymore especially when they do not give a clear error log.

ionic android unexpected token

I am using the Ionic Framework to build a mobile app for Android/iOS. I was able
to build the project for android (ionic build android). When I run the app, it will be only a white screen, that's because there is an error (when you use GapDebug, you can run apps on your phone and you will be able to debug, and see errors). Now if I run it on the desktop browser there really is NO error and everything is working. Below is the error that is shown in GapDebug:
Now when you check the code in service.js line 394:
There's nothing wrong with the code right? If I try to change line 394 to something like key : self.currentUser, there will be NO error and the app will work. What seems to be the problem here?
Not sure why you are making an object's attribute a list? If you want the key to be childQuestionSnapshot.key then remove the square brackets.
If you are trying to update a list of objects, you can do something similar to the below:
var test = [{key: 'thisguy'},{key: 'thatguy'},{key: 'myguy'}]
test.forEach(function(item){
item['key']='newguy'
})
console.log(test)
Do this instead
var updateObj = {};
updateObj[childQuestionSnapshot.key] = self.currentUser;
applicantRef.update(updateObj, function() {
console.log("applicant answers updated");
});

BubblePopupHelper filling Android Debug Log

So I noticed when I was debugging that there seems to be a tag that's repeating through my app entitled "BubblePopupHelper" with text: "isShowingBubblePopup : false"
Screenshot of the log
To my knowledge, I'm not using or causing it. Does anyone have an idea of what's going on? The application is the one I'm writing.
Upon further inspection, I did notice that every time I'm updating text (via a TextView) it displays onscreen. If there's a better way of doing so, please let me know.
Thanks!
The message seems to be logged by some SDK libraries whenever setText is called in a TextView. I get it in Android Studio developing with min API 14.
One interim solution till Google removes it would be using the filtering feature of Android Studio by writing a RegEx that only includes your log messages. For example if I have all my tags start with 'Braim' then 'Braim.*' can be used
If you want to filter this annoying logs away you can use the following regex:
by Log Tag: (?!^BubblePopupHelper)(^.*$)
Have you added "OnGlobalLayoutListener"?
I've encountered same problem and finally I found that getViewTreeObserver().addOnGlobalLayoutListener caused the problem.
Here is my solution:
textView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
#Override
public void onGlobalLayout() {
...
textCategory.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
});

android phonegap if timeout fallback

i'm trying to do a fallback on a timeout event!
ive set super.setingeterproperty("loadurltimeoutvalue", 60") so i can simulate it. Been searching around and havent found alot of answers to this.
I'm trying to do this: if timeout event -> load page from assets folder.
this so i can hide the error message that occurs on timeout. that error message contains the address to the site being loaded, and i dont want that at all to show up anywhere.
if (mWebView.loadUrlTimeout == currentLoadUrlTimeout) {
//super.loadurl("android_assets bla bla")
}
Found that code here, but cant get it to work. i think there are lots of parts missing, to the code, as i tried stripping it.
I am still pretty fresh to this, so there might be really logical flaws which i just dont see.
Any help greatly appreciated :)
Try setting following property in the activity before loading the page, it should work:
super.setStringProperty("errorUrl", "file:///android_asset/www/error_page.html");
setStringProperty has been deprecated in 3.0. Use config.xml instead:
<preference name="ErrorUrl" value="myErrorPage.html"/>

Categories

Resources