Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts


Huawei React Native OneSignal Setup

Open the link below and follow step 1 to step 5.3

Note step 4.3:

Make sure to provide the SHA256 for both debug and release keystore in your huawei config (step 4.5) so that the push will work if you plan to test the push using the command "react-native run-android".

The debug keystore is located under android/app.

If you want to know how to check the SHA256 inside the keystore just refer to the guide below.

Hope this helps


Get android keystore information from APK file

 Just run the command below

keytool -list -v -keystore <keystore-file>

and replace <keystore-file> with your keystore file. You can go directly to the folder and run

keytool -list -v -keystore mykeystore.keystore

or you can specify the path like

keytool -list -v -keystore ~/path/to/my/keystore/mykeystore.keystore


[SOLVED] Task 'installDebug' not found in project error in Mac after using zsh terminal

This error is caused by the terminal no longer identify your environment variables which you set up in "~/.bash_profile" in the previous Mac OS version.

The ZSH terminal is now using "~/.zprofile" for the environment variables so to solve this issue, all you need to do is copy everything inside your "~/.bash_profile" to your "~/.zprofile" and everything should work normally.


SOLVED React Native android build error GC overhead limit exceeded


Today I recently encountered an error while building four react native android applications, the error was:

* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> GC overhead limit exceeded
* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForRelease'.
> GC overhead limit exceeded


It appears it has something to do with the memory of the machine or pc, all I did was restart my pc to clear all the previous processes and clean up the memory usage and then build the app again.

I also noticed that while I was developing for 5 hours, my machine was slowly slowing  down which gave me the hint to restart my pc. Anyways, restarting your machine or pc should fix this issue 95% of the time. Hope this helps.


SOLVED ReactNative WebRTC update issue | Android O (--min-api 26)


I recently upgraded my ReactNative WebRTC version from "1.58.3" to "1.67.1" which causes my app to fail when building or even running it. The exact error I encountered is:

D8: Invoke-customs are only supported starting with Android O (--min-api 26)
D8: Static interface methods are only supported starting with Android N (--min-api 24): org.webrtc.EglBase org.webrtc.EglBase.create()


1. In your project root directory go to "android/app/" and open the file build.gradle

2. Copy and paste the code below within the android config.

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8


Build you react native app again and it should work.


Get string values from Android strings.xml in React Native


I am working on a mobile app project that contains multiple app builds in React Native. Whenever I build a specific app, the string called "app_name" inside my


keeps on changing. I intended to do this so that the native part of my code knows what app I was building.

My goal here is to get the value of the string "app_name" so that can be able to render a specific asset(s) or use a specific java function intended for that app.


I have my strings.xml looks like this:

All I did was create a String function and inside that function I use getResources() and getString() to get the string value of app_name inside strings.xml;

Here is the code:

Using this approach, I am now able to pass the values inside strings.xml to my react native app. I was able to compare the value of the function appName() using appName().equals("appone") that return either true if match or false if not match.

Hope it helps.


Error running 'app': Default Activity not found on Android with Kotlin


I started learning Android and decided to use Kotlin instead of Java so I setup my first project and added MainActivity.kt and started running it in debug mode. I was so excited to run my first native app and see the output but this error killed my excitement.

Error running 'app': Default Activity not found on Android with Kotlin

It felt like I am in between two planets colliding when seeing this error so I took time to do some research and got a solution.


Inside AndroidManifest.xml you have to add the code below within activity tag.

It should look like this:

I ran the code again and it worked perfectly.