'React Native Failed to Build: NDK not installed, even after adding ndk.dir to local.properties

I try to run my react native project, but got NDK not installed error. I already add ndk.dir on local.properties but still the error occurs. enter image description here

This is the error:enter image description here

Any idea what's wrong with my project. Thanks!



Solution 1:[1]

Larme's formula does the trick for me, where the proportion of the second colour (colour at location 1.0 in CGGradientCreateWithColors) that you want expressed (i.e. the "distance" between colour at 0.0 and colour at 1.0) is P in the formula below. The proportion of colour 0 expressed then becomes (1 - P). P is a value between 0..1, so (to state the obvious) 75% of colour 1 gives P = 0.75, and this means colour 0 has 25% expression (1 - 0.75).

CGFloat P = 0.75; // any value between 0.0 .. 1.0
CGFloat b = 1 - P;
UIColor* col0 = [UIColor yellowColour]; // or whatever ...
UIColor* col1 = [UIColor redColor]; // or whatever ...
CGFloat R0,R1,G0,G1,B0,B1,A0,A1;
[col0 getRed:&R0 green:&G0 blue:&B0 alpha:&A0];
[col1 getRed:&R1 green:&G1 blue:&B1 alpha:&A1];
UIColor* blendedColour = [UIColor 
    colorWithRed: R1 * P + R0 * b 
    green:        G1 * P + G0 * b 
    blue:         B1 * P + B0 * b
    alpha:        A1 * P + A0 * b];
// P = 0.75 gives red-orange colour. P = 0.5 gives orange. etc.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 djmlewis