问:
Kotlin - Class Inheritance; Overriding properties
So I started learning Kotlin today and got to Classes when I noticed something weird.
When I run this code:

```<code>fun main() {
    val dog_1 = Dog("Walrek", 7)
}

open class Animal(
    open val type: String,
    open val name: String,
    open val speed: Int,
) {
    init {
        println("(Ani init) New animal: $type called $name with $speed speed")
    }
}

class Dog(
    override val name: String,
    override val speed: Int,
): Animal("Dog", name, speed) {}
</code>```

The init method will print out: (Ani init) New animal: Dog called null with 0 speed.

At first I thought I messed up somewhere and somehow I'm not passing the arguments properly into the Animal class, but then I added these two lines of code:

```<code>init {
    println("(Dog init) New animal: $type called $name with $speed speed")
}
</code>```

into Dog class, and

```<code>println(dog_1.name)
</code>```

in the main function, and got this as an output:

```<code>(Ani init) New animal: Dog called null with 0 speed
(Dog init) New animal: Dog called Walrek with 7 speed
Walrek
</code>```

So now my question is, why weren't the parameters passed into the Animal class, and yet I can access them as usual after creating the Dog instance?

答:
You should be getting a compiler warning. You should never use open properties or functions at construction time (in init blocks or property declarations), because it causes this kind of unwanted behavior. It's just about the only way you can get a NullPointerException in Kotlin without using !!.

The reason it happens is that the superclass's constructor (which includes init blocks and property declarations) is run before the subclass. Since you override the property name in the subclass, the backing field of the property name has not yet been initialized by the time init of the superclass is called, so the property returns the default Java field value of null. In the case of speed, the field type is a Java primitive int so its default value is 0.

Note that in your specific example, there was no need to override these properties because you are passing these values to the superconstructor anyway. You could remove the open keyword before the properties and declare your Dog like:

```<code>class Dog(
    name: String,
    speed: Int,
): Animal("Dog", name, speed) {}
</code>```

Then it will behave properly.

Body:
So I started learning Kotlin today and got to Classes when I noticed something weird.
When I run this code:

fun main() {
    val dog_1 = Dog("Walrek", 7)
}

open class Animal(
    open val type: String,
    open val name: String,
    open val speed: Int,
) {
    init {
        println("(Ani init) New animal: $type called $name with $speed speed")
    }
}

class Dog(
    override val name: String,
    override val speed: Int,
): Animal("Dog", name, speed) {}

The init method will print out: (Ani init) New animal: Dog called null with 0 speed.

At first I thought I messed up somewhere and somehow I'm not passing the arguments properly into the Animal class, but then I added these two lines of code:

init {
    println("(Dog init) New animal: $type called $name with $speed speed")
}

into Dog class, and

println(dog_1.name)

in the main function, and got this as an output:

(Ani init) New animal: Dog called null with 0 speed
(Dog init) New animal: Dog called Walrek with 7 speed
Walrek

So now my question is, why weren't the parameters passed into the Animal class, and yet I can access them as usual after creating the Dog instance?

Body:
You should be getting a compiler warning. You should never use open properties or functions at construction time (in init blocks or property declarations), because it causes this kind of unwanted behavior. It's just about the only way you can get a NullPointerException in Kotlin without using !!.

The reason it happens is that the superclass's constructor (which includes init blocks and property declarations) is run before the subclass. Since you override the property name in the subclass, the backing field of the property name has not yet been initialized by the time init of the superclass is called, so the property returns the default Java field value of null. In the case of speed, the field type is a Java primitive int so its default value is 0.

Note that in your specific example, there was no need to override these properties because you are passing these values to the superconstructor anyway. You could remove the open keyword before the properties and declare your Dog like:

class Dog(
    name: String,
    speed: Int,
): Animal("Dog", name, speed) {}

Then it will behave properly.


来源: stackexchange

问:
Break line when string reaches X characters
I created this function below to calculate when a string (name) reaches more than 35 characters then it break a line.

function getName(name) {
      let newName = name
      for (let i = 0; i < name.length; i += 1) {
        if (i % 35 === 0) {
          newName = `${newName.substr(0, i)}\n${newName.substr(i)}`
        }
      }
      return newName
}

console.log(getName("Please note that popular names below"))```
</div>
</div>
</p>
<p>Eg output:</p>
```Name = "Please note that popular names below"
function output:

Please note that popular names bel
ow
```

What I want is to instead of break a line of these two last characters "ow", I put "below" in the next line.

答:
So you want to find the last space within the first 35 characters and break the line there, right?

You can first slice the first 35 characters and then use regex to find the last space.

To slice the first 35 characters, use name.substr(0,35). This returns a new string with the first 35 characters.

A regular expression that matches the last space is e.g. / (?!.* )/, so you can do replace(/ (?!.* )/, x) where x is whatever you want (new line, in this case).

ContentLicense: CC BY-SA 4.0

Body:
I created this function below to calculate when a string (name) reaches more than 35 characters then it break a line.

function getName(name) {
      let newName = name
      for (let i = 0; i < name.length; i += 1) {
        if (i % 35 === 0) {
          newName = `${newName.substr(0, i)}\n${newName.substr(i)}`
        }
      }
      return newName
}

console.log(getName("Please note that popular names below"))

Eg output:

Name = "Please note that popular names below"
function output:

Please note that popular names bel
ow

What I want is to instead of break a line of these two last characters "ow", I put "below" in the next line.


问:
Number of subsets with a given sum . Recursion not tracing few branches of the tree
I have written this code in python and it is not yielding the right answer for the input wt[]=[2,3,5,6,8,10] in this order . It is giving right answer for few other combinations like wt[]=[3,2,6,10,8,5].I I have also tried tracing the recursive tree to debug accordingly but still cannot figure out why the code is not tracing some branches of the tree.
Kindly please help me figure out the problem.
Thank you!</p>
```<code>n=6      #int(input())
m=10     #int(input())
wt=[2,3,5,6,8,10]
dp_table=[[-1 for i in range(n+1)]for j in range (m+1)]
total=[0]
def SS(m,n):
    a=0
    b=0
    if m==0:
        print(n-1)
        total[0]=total[0]+1
        return 0;
    if n==0:
        return 0;
    else:
        if wt[n-1]>m:
            return (SS(m,n-1));
        else:
            if dp_table[m-wt[n-1]][n-1]==-1:
                a=SS(m-wt[n-1],n-1) + wt[n-1]
            if dp_table[m][n-1]==-1:
                b=SS(m,n-1)
            dp_table[m][n]=max(a,b)

        return dp_table[m][n];
if m==0 or n==0:
    print("Not Possible!")
if SS(m,n)==m:
    print("Possible and the no of subsets with equal sum are: ",total[0])
else:
    print("False")
</code>```

答:
You're storing results in dp_table but never using them (giving incorrect results). If the dp_table value of an entry isn't -1, you're ignoring the result (and assuming it's always 0).

Often it's better to do the cache-checks at the top of the function (or better yet, use functools.cache).

If you really want to keep the code structured as it is now, this will fix the issue:

def SS(m, n):
    a = dp_table[m - wt[n - 1]][n - 1]
    b = dp_table[m][n - 1]
    if m == 0:
        total[0] += 1
        return 0
    if n == 0:
        return 0
    else:
        if wt[n - 1] > m:
            dp_table[m][n] = b if b != -1 else SS(m, n - 1)
        else:
            if a == -1:
                a = SS(m - wt[n - 1], n - 1)
            a += wt[n - 1]
            if b == -1:
                b = SS(m, n - 1)
            dp_table[m][n] = max(a, b)

        return dp_table[m][n]
```
<p>If you want to do the caching yourself, you can put cache checks at the top (a better approach), rather than putting a check (and an if-else statement) before every recursive call, like this:</p>
<pre class="lang-py prettyprint-override"><code>def SS2(m, n):
    if dp_table[m][n] != -1:
        return dp_table[m][n]
    if m == 0:
        total[0] += 1
        dp_table[m][n] = 0
    elif n == 0:
        dp_table[m][n] = 0
    else:
        if wt[n - 1] > m:
            dp_table[m][n] = SS(m, n - 1)
        else:
            dp_table[m][n] = max(SS(m - wt[n - 1], n - 1) + wt[n - 1], SS(m, n - 1))

    return dp_table[m][n]
</code>```

But the most 'Pythonic' and least work alternative is to use the decorators built into the standard library. You can limit the total memory usage, and it might even be faster if your manual DP-table happens to have cache-unfriendly access patterns.

import functools

@functools.cache
def SS3(m, n):
    if m == 0:
        total[0] += 1
        return 0
    elif n == 0:
        return 0
    else:
        if wt[n - 1] > m:
            return SS(m, n - 1)
        else:
            return max(SS(m - wt[n - 1], n - 1) + wt[n - 1], SS(m, n - 1))
```

Body:
I have written this code in python and it is not yielding the right answer for the input wt[]=[2,3,5,6,8,10] in this order . It is giving right answer for few other combinations like wt[]=[3,2,6,10,8,5].I I have also tried tracing the recursive tree to debug accordingly but still cannot figure out why the code is not tracing some branches of the tree.
Kindly please help me figure out the problem.
Thank you!

n=6      #int(input())
m=10     #int(input())
wt=[2,3,5,6,8,10]
dp_table=[[-1 for i in range(n+1)]for j in range (m+1)]
total=[0]
def SS(m,n):
    a=0
    b=0
    if m==0:
        print(n-1)
        total[0]=total[0]+1
        return 0;
    if n==0:
        return 0;
    else:
        if wt[n-1]>m:
            return (SS(m,n-1));
        else:
            if dp_table[m-wt[n-1]][n-1]==-1:
                a=SS(m-wt[n-1],n-1) + wt[n-1]
            if dp_table[m][n-1]==-1:
                b=SS(m,n-1)
            dp_table[m][n]=max(a,b)

        return dp_table[m][n];
if m==0 or n==0:
    print("Not Possible!")
if SS(m,n)==m:
    print("Possible and the no of subsets with equal sum are: ",total[0])
else:
    print("False")

Body:
You're storing results in dp_table but never using them (giving incorrect results). If the dp_table value of an entry isn't -1, you're ignoring the result (and assuming it's always 0).

Often it's better to do the cache-checks at the top of the function (or better yet, use functools.cache).

If you really want to keep the code structured as it is now, this will fix the issue:

def SS(m, n):
    a = dp_table[m - wt[n - 1]][n - 1]
    b = dp_table[m][n - 1]
    if m == 0:
        total[0] += 1
        return 0
    if n == 0:
        return 0
    else:
        if wt[n - 1] > m:
            dp_table[m][n] = b if b != -1 else SS(m, n - 1)
        else:
            if a == -1:
                a = SS(m - wt[n - 1], n - 1)
            a += wt[n - 1]
            if b == -1:
                b = SS(m, n - 1)
            dp_table[m][n] = max(a, b)

        return dp_table[m][n]

If you want to do the caching yourself, you can put cache checks at the top (a better approach), rather than putting a check (and an if-else statement) before every recursive call, like this:

def SS2(m, n):
    if dp_table[m][n] != -1:
        return dp_table[m][n]
    if m == 0:
        total[0] += 1
        dp_table[m][n] = 0
    elif n == 0:
        dp_table[m][n] = 0
    else:
        if wt[n - 1] > m:
            dp_table[m][n] = SS(m, n - 1)
        else:
            dp_table[m][n] = max(SS(m - wt[n - 1], n - 1) + wt[n - 1], SS(m, n - 1))

    return dp_table[m][n]

But the most 'Pythonic' and least work alternative is to use the decorators built into the standard library. You can limit the total memory usage, and it might even be faster if your manual DP-table happens to have cache-unfriendly access patterns.

import functools

@functools.cache
def SS3(m, n):
    if m == 0:
        total[0] += 1
        return 0
    elif n == 0:
        return 0
    else:
        if wt[n - 1] > m:
            return SS(m, n - 1)
        else:
            return max(SS(m - wt[n - 1], n - 1) + wt[n - 1], SS(m, n - 1))


问:
difflib.get_close_matches GET SCORE
I am trying to get the score of the best match using difflib.get_close_matches:

```<code>import difflib

best_match = difflib.get_close_matches(str,str_list,1)[0]
</code>```

I know of the option to add 'cutoff' parameter, but couldn't find out how to get the actual score after setting the threshold.
Am I missing something? Is there a better solution to match unicode strings?

答:
To answer the question, the usual route would be to obtain the comparative score for a match returned by get_close_matches() individually in this manner:

```<code>match_ratio = difflib.SequenceMatcher(None, 'aple', 'apple').ratio()
</code>```

Here's a way that increases speed in my case by about 10% ...

I'm using get_close_matches() for spellcheck, it runs SequenceMatcher() under the hood but strips the scores returning just a list of matching strings. Normally.

But with a small change in Lib/difflib.py currently around line 736 the return can be a dictionary with scores as values, thus no need to run SequenceMatcher again on each list item to obtain their score ratios. In the examples I've shortened the output float values for clarity (like 0.8888888888888888 to 0.889). Input n=7 says to limit the return items to 7 if there are more than 7, i.e. the highest 7, and that could apply if candidates are many.

Current mere list return

In this example result would normally be like ['apple', 'staple', 'able', 'lapel']

... at the default cutoff of .6 if omitted (as in Ben's answer, no judgement).

The change

in difflib.py is simple (this line to the right shows the original):

```<code>return {v: k for (k, v) in result}  # hack to return dict with scores instead of list, original was ... [x for score, x in result]
</code>```

New dictionary return

includes scores like {'apple': 0.889, 'staple': 0.8, 'able': 0.75, 'lapel': 0.667}

```<code>>>> to_match = 'aple'
>>> candidates = ['lapel', 'staple', 'zoo', 'able', 'apple', 'appealing']
</code>```

Increasing minimum score cutoff/threshold from .4 to .8:

```<code>>>> difflib.get_close_matches(to_match, candidates, n=7, cutoff=.4)
{'apple': 0.889, 'staple': 0.8, 'able': 0.75, 'lapel': 0.667, 'appealing': 0.461}

>>> difflib.get_close_matches(to_match, candidates, n=7, cutoff=.7)
{'apple': 0.889, 'staple': 0.8, 'able': 0.75}

>>> difflib.get_close_matches(to_match, candidates, n=7, cutoff=.8)
{'apple': 0.889, 'staple': 0.8}
</code>```

ContentLicense: CC BY-SA 3.0

Title: difflib.get_close_matches GET SCORE

Body:
I am trying to get the score of the best match using difflib.get_close_matches:

import difflib

best_match = difflib.get_close_matches(str,str_list,1)[0]

I know of the option to add 'cutoff' parameter, but couldn't find out how to get the actual score after setting the threshold.
Am I missing something? Is there a better solution to match unicode strings?

Body:
To answer the question, the usual route would be to obtain the comparative score for a match returned by get_close_matches() individually in this manner:

match_ratio = difflib.SequenceMatcher(None, 'aple', 'apple').ratio()

Here's a way that increases speed in my case by about 10% ...

I'm using get_close_matches() for spellcheck, it runs SequenceMatcher() under the hood but strips the scores returning just a list of matching strings. Normally.

But with a small change in Lib/difflib.py currently around line 736 the return can be a dictionary with scores as values, thus no need to run SequenceMatcher again on each list item to obtain their score ratios. In the examples I've shortened the output float values for clarity (like 0.8888888888888888 to 0.889). Input n=7 says to limit the return items to 7 if there are more than 7, i.e. the highest 7, and that could apply if candidates are many.

Current mere list return

In this example result would normally be like ['apple', 'staple', 'able', 'lapel']

... at the default cutoff of .6 if omitted (as in Ben's answer, no judgement).

The change

in difflib.py is simple (this line to the right shows the original):

return {v: k for (k, v) in result}  # hack to return dict with scores instead of list, original was ... [x for score, x in result]

New dictionary return

includes scores like {'apple': 0.889, 'staple': 0.8, 'able': 0.75, 'lapel': 0.667}

>>> to_match = 'aple'
>>> candidates = ['lapel', 'staple', 'zoo', 'able', 'apple', 'appealing']

Increasing minimum score cutoff/threshold from .4 to .8:

>>> difflib.get_close_matches(to_match, candidates, n=7, cutoff=.4)
{'apple': 0.889, 'staple': 0.8, 'able': 0.75, 'lapel': 0.667, 'appealing': 0.461}

>>> difflib.get_close_matches(to_match, candidates, n=7, cutoff=.7)
{'apple': 0.889, 'staple': 0.8, 'able': 0.75}

>>> difflib.get_close_matches(to_match, candidates, n=7, cutoff=.8)
{'apple': 0.889, 'staple': 0.8}


问:
Reactjs server out of memory problem & so laggy after adding local videos streaming?
Server was so laggy after adding videos to stream on local server on src folder</p>

答:
The solution was to move the video to public/videos/videoTest.mp4 folder
install miui library to use card media component or use any other video
& to access them like this:

```<code>const videoPath = process.env.PUBLIC_URL; // to fetch an OS(Windows, Mac, Linux) independent path
const videoTest = "/videos/videoTest.mp4";
// install miui library to use card media component or use any other video
 <CardMedia
          height={"100%"}
          component="video"
          controls
          src={videoPath + videoTest}
        ></CardMedia>
</code>```

& u can also compress videos to make it even faster with tools like handlebreak

Body:
The solution was to move the video to public/videos/videoTest.mp4 folder
install miui library to use card media component or use any other video
& to access them like this:

const videoPath = process.env.PUBLIC_URL; // to fetch an OS(Windows, Mac, Linux) independent path
const videoTest = "/videos/videoTest.mp4";
// install miui library to use card media component or use any other video
 <CardMedia
          height={"100%"}
          component="video"
          controls
          src={videoPath + videoTest}
        ></CardMedia>

& u can also compress videos to make it even faster with tools like handlebreak


问:
ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 256, 256, 3), found shape=(None, 33)
I started running dukkakc's code about DeepSuccinySite and i have a problem. The result show: ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 256, 256, 3), found shape=(None, 33). I've been searching for the error for a long time but to no avail. Can someone help me?</p>
```<code>from tensorflow import keras
import numpy as np
from Bio import SeqIO
from numpy import array
from imblearn.under_sampling import RandomUnderSampler
from sklearn.utils import shuffle
from sklearn.metrics import roc_curve, auc, classification_report
from keras.models import load_model

r_test_x = []
r_test_y = []
posit_1 = 1;
negat_0 = 0;
win_size = 33 # actual window size
win_size_kernel = int(win_size/2 + 1)

# define universe of possible input values
alphabet = 'ARNDCQEGHILKMFPSTWYV-'
# define a mapping of chars to integers
char_to_int = dict((c, i) for i, c in enumerate(alphabet))
int_to_char = dict((i, c) for i, c in enumerate(alphabet))

#-------------------------TEST DATASET----------------------------------------
#for positive sequence
def innertest1():
#Input
data = seq_record.seq
#rint(data)
# integer encode input data
for char in data:
    if char not in alphabet:
        return
integer_encoded = [char_to_int[char] for char in data]
r_test_x.append(integer_encoded)
r_test_y.append(posit_1)
for seq_record in SeqIO.parse("test_positive_sites.fasta", "fasta"):
innertest1()
#for negative sequence
def innertest2():
#Input
data = seq_record.seq
#print(data)
# integer encode input data
for char in data:
    if char not in alphabet:
        return
integer_encoded = [char_to_int[char] for char in data]
r_test_x.append(integer_encoded)
r_test_y.append(negat_0)
for seq_record in SeqIO.parse("test_negative_sites.fasta", "fasta"):
innertest2()
# Changing to array (matrix)
r_test_x = array(r_test_x)
r_test_y = array(r_test_y)

# Balancing test dataset
# Testing Data Balancing by undersampling####################################
rus = RandomUnderSampler(random_state=7)
x_res3, y_res3 = rus.fit_resample(r_test_x, r_test_y)
#Shuffling
r_test_x, r_test_y = shuffle(x_res3, y_res3, random_state=7)
r_test_x = np.array(r_test_x)
r_test_y = np.array(r_test_y)
############################################################################

##LOAD MODEL####
model = load_model('model.h5')
#print("This is final ",model.layers[0].get_weights()[0][16])
r_test_y_2 = keras.utils.to_categorical(r_test_y, 2)
score = model.evaluate(r_test_x, r_test_y_2, verbose=0)
print('Test loss:', score[0])
print('Test accuracy:', score[1])

from sklearn.metrics import matthews_corrcoef
from sklearn.metrics import confusion_matrix
Y_pred = model.predict(r_test_x)
Y_pred = (Y_pred > 0.5)
y_pred1 = [np.argmax(y, axis=None, out=None) for y in Y_pred]
y_pred1 = np.array(y_pred1)

print("Matthews Correlation : ",matthews_corrcoef(r_test_y, y_pred1))
print("Confusion Matrix : \n",confusion_matrix(r_test_y, y_pred1))
# ROC

fpr, tpr, _ = roc_curve(r_test_y, y_pred1)
roc_auc = auc(fpr, tpr)
print("AUC : ", roc_auc)
print(classification_report(r_test_y, y_pred1))

print(model.summary())
</code>```

答:
Your input has to match the expected format of the input layer of your model.
You can use reshape to get the right format, expected the dimension match, otherwise you'll need to pad the missing dimensions.

```<code>import numpy as np

A = np.random.rand(16,1,1)
A.shape
  (16,1,1)

B = A.reshape([4,4,1,1]
B.shape
  (4,4,1,1)
</code>```

Body:
I started running dukkakc's code about DeepSuccinySite and i have a problem. The result show: ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 256, 256, 3), found shape=(None, 33). I've been searching for the error for a long time but to no avail. Can someone help me?

from tensorflow import keras
import numpy as np
from Bio import SeqIO
from numpy import array
from imblearn.under_sampling import RandomUnderSampler
from sklearn.utils import shuffle
from sklearn.metrics import roc_curve, auc, classification_report
from keras.models import load_model

r_test_x = []
r_test_y = []
posit_1 = 1;
negat_0 = 0;
win_size = 33 # actual window size
win_size_kernel = int(win_size/2 + 1)

# define universe of possible input values
alphabet = 'ARNDCQEGHILKMFPSTWYV-'
# define a mapping of chars to integers
char_to_int = dict((c, i) for i, c in enumerate(alphabet))
int_to_char = dict((i, c) for i, c in enumerate(alphabet))

#-------------------------TEST DATASET----------------------------------------
#for positive sequence
def innertest1():
#Input
data = seq_record.seq
#rint(data)
# integer encode input data
for char in data:
    if char not in alphabet:
        return
integer_encoded = [char_to_int[char] for char in data]
r_test_x.append(integer_encoded)
r_test_y.append(posit_1)
for seq_record in SeqIO.parse("test_positive_sites.fasta", "fasta"):
innertest1()
#for negative sequence
def innertest2():
#Input
data = seq_record.seq
#print(data)
# integer encode input data
for char in data:
    if char not in alphabet:
        return
integer_encoded = [char_to_int[char] for char in data]
r_test_x.append(integer_encoded)
r_test_y.append(negat_0)
for seq_record in SeqIO.parse("test_negative_sites.fasta", "fasta"):
innertest2()
# Changing to array (matrix)
r_test_x = array(r_test_x)
r_test_y = array(r_test_y)

# Balancing test dataset
# Testing Data Balancing by undersampling####################################
rus = RandomUnderSampler(random_state=7)
x_res3, y_res3 = rus.fit_resample(r_test_x, r_test_y)
#Shuffling
r_test_x, r_test_y = shuffle(x_res3, y_res3, random_state=7)
r_test_x = np.array(r_test_x)
r_test_y = np.array(r_test_y)
############################################################################

##LOAD MODEL####
model = load_model('model.h5')
#print("This is final ",model.layers[0].get_weights()[0][16])
r_test_y_2 = keras.utils.to_categorical(r_test_y, 2)
score = model.evaluate(r_test_x, r_test_y_2, verbose=0)
print('Test loss:', score[0])
print('Test accuracy:', score[1])

from sklearn.metrics import matthews_corrcoef
from sklearn.metrics import confusion_matrix
Y_pred = model.predict(r_test_x)
Y_pred = (Y_pred > 0.5)
y_pred1 = [np.argmax(y, axis=None, out=None) for y in Y_pred]
y_pred1 = np.array(y_pred1)

print("Matthews Correlation : ",matthews_corrcoef(r_test_y, y_pred1))
print("Confusion Matrix : \n",confusion_matrix(r_test_y, y_pred1))
# ROC

fpr, tpr, _ = roc_curve(r_test_y, y_pred1)
roc_auc = auc(fpr, tpr)
print("AUC : ", roc_auc)
print(classification_report(r_test_y, y_pred1))

print(model.summary())

Body:
Your input has to match the expected format of the input layer of your model.
You can use reshape to get the right format, expected the dimension match, otherwise you'll need to pad the missing dimensions.

import numpy as np

A = np.random.rand(16,1,1)
A.shape
  (16,1,1)

B = A.reshape([4,4,1,1]
B.shape
  (4,4,1,1)


问:
How to set params dynamically for AjaxUpload?
I have created a function to upload a file using this library as follows:

```<code>new AjaxUpload($('#addImage'), {
                action: 'SaveDataBank.aspx',
                name: 'uploadimage',
                dataType: 'json',
                params: { clientid: GetSelectedClient() }
                onSubmit: function (file, ext) {
                },
                onComplete: function (file, response) {
                }
            });
</code>```

I would like to perform some task before opening a file dialog. How could I update the above code?

UPDATE:

I would like to pass a parameter dynamically with the file upload. I have a dropdown containing a list of client ids. If I click on the Upload button it will open File Dialog. I would then like it to pass in the selected client from the dropdown. Currently, it only passes the initially selected value.

```<code>params: { clientid: GetSelectedClient() },
</code>```

The above line does not work as per my requirement.

答:
First idea (which doesn't work)

Try binding a click handler to the button. If you don't return false or stop propagation, it will trigger the file uploader after the click handler finishes:

```<code>$('#addImage').click(function(){
    // code here
});

new AjaxUpload($('#addImage'), {
                action: 'SaveDataBank.aspx',
                name: 'uploadimage',
                dataType: 'json'
            });
</code>```

This doesn't work because the AjaxUpload library creates an input element which it puts over the top of the button when you hover over the button. It's actually the input element that you click.

Work around

Bind to the click event of the input that you actually click on. This does not exist on page load, so we have to use the jQuery live function:

```<code>new AjaxUpload($('#addImage'), {
                action: 'SaveDataBank.aspx',
                name: 'uploadimage',
                dataType: 'json'
            });

$('input[type="file"]').live('click', function(e){
    // code here
});
</code>```

See my updated fiddle for a working example.

Passing dynamic data

To pass dynamic data along with your file upload, add a setData call in the onSubmit handler:

```<code>new AjaxUpload($('#addImage'), {
            action: 'SaveDataBank.aspx',
            name: 'uploadimage',
            dataType: 'json',
            onSubmit: function (file, ext) {
                this.setData({clientid: GetSelectedClient()});
            }
        });
</code>```

Conclusions

This shows that the library is a bit awkward to work with. You don't click the button, so you won't get normal button effects (i.e. it becoming indented when mouse down). Any JavaScript which relies on the button events will not work as expected. You can go with the above solution, but personally, I would look for a different library. Maybe the newer one that replaces this? Here are a bunch of others and some more.

Body:
I have created a function to upload a file using this library as follows:

new AjaxUpload($('#addImage'), {
                action: 'SaveDataBank.aspx',
                name: 'uploadimage',
                dataType: 'json',
                params: { clientid: GetSelectedClient() }
                onSubmit: function (file, ext) {
                },
                onComplete: function (file, response) {
                }
            });

I would like to perform some task before opening a file dialog. How could I update the above code?

UPDATE:

I would like to pass a parameter dynamically with the file upload. I have a dropdown containing a list of client ids. If I click on the Upload button it will open File Dialog. I would then like it to pass in the selected client from the dropdown. Currently, it only passes the initially selected value.

params: { clientid: GetSelectedClient() },

The above line does not work as per my requirement.

Body:
First idea (which doesn't work)

Try binding a click handler to the button. If you don't return false or stop propagation, it will trigger the file uploader after the click handler finishes:

$('#addImage').click(function(){
    // code here
});

new AjaxUpload($('#addImage'), {
                action: 'SaveDataBank.aspx',
                name: 'uploadimage',
                dataType: 'json'
            });

This doesn't work because the AjaxUpload library creates an input element which it puts over the top of the button when you hover over the button. It's actually the input element that you click.

Work around

Bind to the click event of the input that you actually click on. This does not exist on page load, so we have to use the jQuery live function:

new AjaxUpload($('#addImage'), {
                action: 'SaveDataBank.aspx',
                name: 'uploadimage',
                dataType: 'json'
            });

$('input[type="file"]').live('click', function(e){
    // code here
});

See my updated fiddle for a working example.

Passing dynamic data

To pass dynamic data along with your file upload, add a setData call in the onSubmit handler:

new AjaxUpload($('#addImage'), {
            action: 'SaveDataBank.aspx',
            name: 'uploadimage',
            dataType: 'json',
            onSubmit: function (file, ext) {
                this.setData({clientid: GetSelectedClient()});
            }
        });

Conclusions

This shows that the library is a bit awkward to work with. You don't click the button, so you won't get normal button effects (i.e. it becoming indented when mouse down). Any JavaScript which relies on the button events will not work as expected. You can go with the above solution, but personally, I would look for a different library. Maybe the newer one that replaces this? Here are a bunch of others and some more.


问:
PayPal IPNs sent to old URL
I am using IPN to be notified of new payments from PayPal on my site. I have changed the URL address of the listener page, but after several hours messages for new orders are still being sent to the old URL. I even totally disabled IPNs and re-enabled them, still old URL is used. Is there something I can do, will it eventually resolve?</p>

答:
If a notify_url is specified in the set up of each transaction, that URL will be used. This always takes precedence over any account-level IPN URL setting.

So, most likely you need to update/change your integration to pass the new desired notify_url when sending over each transaction (form post or SetExpressCheckout API call, typically)

Notifications for events on previous transactions, such as refunds or transactions for subscriptions created with the old notify_url , will still go to that old url. This can't be changed.

Title: PayPal IPNs sent to old URL


问:
Google Sheets Nested Query with Aggregate Function
I am trying to use the COUNT() function inside a nested query for Google Sheets. Here is the query I am using: =query('Salary Data'!B3:J35000, "SELECT '"&query('Salary Data'!B3:J35000, "SELECT COUNT(E) WHERE E >= 1000000")&"', COUNT(E) WHERE E >=900000 AND E < 1000000")

The query outputs 'count' for the result of the nested query instead of the count of salaries >= 1000000. How do I get the actual count from the subquery?

EDIT: It seems the subquery only returns the name of the aggregate function used, whether it is count, max, min, avg, etc.

答:
May be

```<code>={query('Salary Data'!B3:J35000, "SELECT COUNT(E) WHERE E > 90000 and E >= 1000000"),query('Salary Data'!B3:J35000, "SELECT COUNT(E) WHERE E >= 1000000")}
</code>```

I really don't understand what you expect!

Body:
May be

={query('Salary Data'!B3:J35000, "SELECT COUNT(E) WHERE E > 90000 and E >= 1000000"),query('Salary Data'!B3:J35000, "SELECT COUNT(E) WHERE E >= 1000000")}

I really don't understand what you expect!


问:
org.gradle.api.InvalidUserCodeException: Querying the mapped value of provider (java.util.Set) before task ... has completed is not supported
I upgraded my project to Android Studio Arctic Fox, so I have to upgrade gradle to 7.0.2 and gradle build tool to 7.0.0-beta04.

After synchronizing, I got this warning message in Sync tab:

```org.gradle.api.InvalidUserCodeException: Querying the mapped value of provider(interface java.util.Set) before task ':myapp:compileDebugUnitTestKotlin' has completed is not supported
    at org.gradle.api.internal.provider.TransformBackedProvider.lambda$beforeRead$0(TransformBackedProvider.java:84)
    at org.gradle.api.internal.file.AbstractFileCollection$ElementsProvider$1.visitProducerTasks(AbstractFileCollection.java:361)
    at org.gradle.api.internal.provider.ValueSupplier$ValueProducer.visitContentProducerTasks(ValueSupplier.java:59)
    at org.gradle.api.internal.provider.TransformBackedProvider.beforeRead(TransformBackedProvider.java:81)
    at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:63)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
    at org.gradle.api.internal.provider.Collectors$ElementsFromCollectionProvider.collectEntries(Collectors.java:216)
    at org.gradle.api.internal.provider.AbstractCollectionProperty$PlusCollector.collectEntries(AbstractCollectionProperty.java:445)
    at org.gradle.api.internal.provider.AbstractCollectionProperty$PlusCollector.collectEntries(AbstractCollectionProperty.java:445)
    at org.gradle.api.internal.provider.AbstractCollectionProperty$CollectingSupplier.calculateValue(AbstractCollectionProperty.java:337)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:184)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:37)
    at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:133)
    at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:127)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
    at org.gradle.api.internal.provider.Collectors$ElementsFromCollectionProvider.collectEntries(Collectors.java:216)
    at org.gradle.api.internal.provider.AbstractCollectionProperty$CollectingSupplier.calculateValue(AbstractCollectionProperty.java:337)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:184)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:37)
    at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:133)
    at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:127)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
    at org.gradle.api.internal.provider.Collectors$ElementsFromCollectionProvider.collectEntries(Collectors.java:216)
    at org.gradle.api.internal.provider.AbstractCollectionProperty$CollectingSupplier.calculateValue(AbstractCollectionProperty.java:337)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:184)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:37)
    at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:133)
    at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:127)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.get(AbstractMinimalProvider.java:84)
    at org.gradle.api.internal.provider.ProviderResolutionStrategy$2.resolve(ProviderResolutionStrategy.java:33)
    at org.gradle.api.internal.file.collections.ProviderBackedFileCollection.visitChildren(ProviderBackedFileCollection.java:63)
    at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:119)
    at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
    at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:119)
    at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:74)
    at org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection$UnresolvedItemsCollector.visitContents(DefaultConfigurableFileCollection.java:372)
    at org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection.visitChildren(DefaultConfigurableFileCollection.java:284)
    at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:119)
    at org.gradle.api.internal.file.AbstractFileCollection.getFiles(AbstractFileCollection.java:130)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl.getPaths(ExternalTestsModelBuilderImpl.groovy:94)
    at jdk.internal.reflect.GeneratedMethodAccessor813.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
    at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:149)
    at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:100)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:231)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl.getClassesDirs(ExternalTestsModelBuilderImpl.groovy:81)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl.access$0(ExternalTestsModelBuilderImpl.groovy)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl$_getMapping_closure1.doCall(ExternalTestsModelBuilderImpl.groovy:41)
    at jdk.internal.reflect.GeneratedMethodAccessor811.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
    at groovy.lang.Closure.call(Closure.java:412)
    at groovy.lang.Closure.call(Closure.java:428)
    at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71)
    at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)
    at org.gradle.util.ConfigureUtil.configureSelf(ConfigureUtil.java:130)
    at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:616)
    at org.gradle.api.DefaultTask.configure(DefaultTask.java:307)
    at org.gradle.api.DefaultTask.configure(DefaultTask.java:44)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:103)
    at org.gradle.util.ConfigureUtil$WrappedConfigureAction.execute(ConfigureUtil.java:166)
    at org.gradle.api.internal.collections.CollectionFilter$1.execute(CollectionFilter.java:59)
    at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:163)
    at org.gradle.api.internal.tasks.DefaultRealizableTaskCollection.all(DefaultRealizableTaskCollection.java:224)
    at org.gradle.api.internal.DefaultDomainObjectCollection.withType(DefaultDomainObjectCollection.java:205)
    at org.gradle.api.internal.DefaultDomainObjectCollection.withType(DefaultDomainObjectCollection.java:211)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl.getMapping(ExternalTestsModelBuilderImpl.groovy:40)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl.buildAll(ExternalTestsModelBuilderImpl.groovy:29)
    at org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder.buildAll(ExtraModelBuilder.java:115)
    at org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder.buildAll(ExtraModelBuilder.java:80)
    at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$BuilderWithParameter.build(DefaultToolingModelBuilderRegistry.java:192)
    at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$LockSingleProjectBuilder.lambda$build$0(DefaultToolingModelBuilderRegistry.java:211)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$3(DefaultProjectStateRegistry.java:310)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:310)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:291)
    at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$LockSingleProjectBuilder.build(DefaultToolingModelBuilderRegistry.java:211)
    at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$BuildOperationWrappingBuilder$1.call(DefaultToolingModelBuilderRegistry.java:246)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
    at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
    at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$BuildOperationWrappingBuilder.build(DefaultToolingModelBuilderRegistry.java:243)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getModel(DefaultBuildController.java:102)
    at org.gradle.tooling.internal.consumer.connection.ParameterAwareBuildControllerAdapter.getModel(ParameterAwareBuildControllerAdapter.java:39)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.getModel(UnparameterizedBuildController.java:113)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.getModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:97)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:81)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction$MyBuildController.findModel(ProjectImportAction.java:542)
    at org.jetbrains.plugins.gradle.model.ClassSetImportModelProvider.populateProjectModels(ClassSetImportModelProvider.java:39)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.addProjectModels(ProjectImportAction.java:201)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:114)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:41)
    at org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:64)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionRunningListener.runAction(AbstractClientProvidedBuildActionRunner.java:134)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionRunningListener.buildFinished(AbstractClientProvidedBuildActionRunner.java:119)
    at jdk.internal.reflect.GeneratedMethodAccessor766.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:398)
    at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:380)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
    at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:368)
    at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:355)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
    at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:245)
    at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:157)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
    at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
    at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
    at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
    at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
    at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
    at com.sun.proxy.$Proxy19.buildFinished(Unknown Source)
    at org.gradle.initialization.DefaultGradleLauncher.finishBuild(DefaultGradleLauncher.java:196)
    at org.gradle.initialization.DefaultGradleLauncher.finishBuild(DefaultGradleLauncher.java:132)
    at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:72)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner.runClientAction(AbstractClientProvidedBuildActionRunner.java:53)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:47)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:66)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:90)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
    at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.lambda$execute$0(InProcessBuildActionExecuter.java:59)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:58)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeScopeLifecycleBuildActionExecuter.java:34)
    at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:53)
    at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:33)
    at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:28)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:104)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:64)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:37)
    at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(SessionScopeLifecycleBuildActionExecuter.java:54)
    at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67)
    at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:50)
    at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:58)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    at java.base/java.lang.Thread.run(Thread.java:834)
```
<p>Not sure what I have to do to fix this problem.</p>
<p>Here is my <code>gradle-wrapper.properties</code></p>
```#Sat Jul 18 00:44:27 AEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
# https://services.gradle.org/distributions/
```
<p>Here is <code>build.gradle</code> for the project level:</p>
```// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.5.10'
    // Import the BoM for the Firebase platform: https://firebase.google.com/docs/android/learn-more?authuser=0#bom
    ext.firebase_bom_version = '28.2.0'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.0-beta04'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.8'
        classpath "io.realm:realm-gradle-plugin:6.1.0"

        // https://firebase.google.com/docs/crashlytics/get-started?platform=android&authuser=0#add-sdk
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
```
<p>Here is <code>build.gradle</code> from one of the app:</p>
```apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"
    ndkVersion "21.3.6528147"

    defaultConfig {
        applicationId "com.abc.apps.myapp"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 29
        versionName "6.5"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    buildFeatures {
        viewBinding true
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
}

dependencies {
    implementation platform("com.google.firebase:firebase-bom:$firebase_bom_version")
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':nextgenlib')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'androidx.core:core-ktx:1.5.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-crashlytics-ktx'
    implementation 'com.google.firebase:firebase-messaging-ktx'
}
```

I hope someone can help me.

答:
In most cases, it's an incompatibility issue between Gradle & Android Gradle Plugin.

Gradle: x.x.x

AGP: y.y.y

Play with these versions to find a proper match.

As for now, in my case works

classpath 'com.android.tools.build:gradle:4.2.2'

Gradle 7.4

Body:
I upgraded my project to Android Studio Arctic Fox, so I have to upgrade gradle to 7.0.2 and gradle build tool to 7.0.0-beta04.

After synchronizing, I got this warning message in Sync tab:

org.gradle.api.InvalidUserCodeException: Querying the mapped value of provider(interface java.util.Set) before task ':myapp:compileDebugUnitTestKotlin' has completed is not supported
    at org.gradle.api.internal.provider.TransformBackedProvider.lambda$beforeRead$0(TransformBackedProvider.java:84)
    at org.gradle.api.internal.file.AbstractFileCollection$ElementsProvider$1.visitProducerTasks(AbstractFileCollection.java:361)
    at org.gradle.api.internal.provider.ValueSupplier$ValueProducer.visitContentProducerTasks(ValueSupplier.java:59)
    at org.gradle.api.internal.provider.TransformBackedProvider.beforeRead(TransformBackedProvider.java:81)
    at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:63)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
    at org.gradle.api.internal.provider.Collectors$ElementsFromCollectionProvider.collectEntries(Collectors.java:216)
    at org.gradle.api.internal.provider.AbstractCollectionProperty$PlusCollector.collectEntries(AbstractCollectionProperty.java:445)
    at org.gradle.api.internal.provider.AbstractCollectionProperty$PlusCollector.collectEntries(AbstractCollectionProperty.java:445)
    at org.gradle.api.internal.provider.AbstractCollectionProperty$CollectingSupplier.calculateValue(AbstractCollectionProperty.java:337)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:184)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:37)
    at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:133)
    at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:127)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
    at org.gradle.api.internal.provider.Collectors$ElementsFromCollectionProvider.collectEntries(Collectors.java:216)
    at org.gradle.api.internal.provider.AbstractCollectionProperty$CollectingSupplier.calculateValue(AbstractCollectionProperty.java:337)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:184)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:37)
    at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:133)
    at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:127)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
    at org.gradle.api.internal.provider.Collectors$ElementsFromCollectionProvider.collectEntries(Collectors.java:216)
    at org.gradle.api.internal.provider.AbstractCollectionProperty$CollectingSupplier.calculateValue(AbstractCollectionProperty.java:337)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:184)
    at org.gradle.api.internal.provider.AbstractCollectionProperty.calculateValueFrom(AbstractCollectionProperty.java:37)
    at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:133)
    at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:127)
    at org.gradle.api.internal.provider.AbstractMinimalProvider.get(AbstractMinimalProvider.java:84)
    at org.gradle.api.internal.provider.ProviderResolutionStrategy$2.resolve(ProviderResolutionStrategy.java:33)
    at org.gradle.api.internal.file.collections.ProviderBackedFileCollection.visitChildren(ProviderBackedFileCollection.java:63)
    at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:119)
    at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
    at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:119)
    at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:74)
    at org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection$UnresolvedItemsCollector.visitContents(DefaultConfigurableFileCollection.java:372)
    at org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection.visitChildren(DefaultConfigurableFileCollection.java:284)
    at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:119)
    at org.gradle.api.internal.file.AbstractFileCollection.getFiles(AbstractFileCollection.java:130)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl.getPaths(ExternalTestsModelBuilderImpl.groovy:94)
    at jdk.internal.reflect.GeneratedMethodAccessor813.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
    at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:149)
    at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:100)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:231)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl.getClassesDirs(ExternalTestsModelBuilderImpl.groovy:81)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl.access$0(ExternalTestsModelBuilderImpl.groovy)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl$_getMapping_closure1.doCall(ExternalTestsModelBuilderImpl.groovy:41)
    at jdk.internal.reflect.GeneratedMethodAccessor811.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
    at groovy.lang.Closure.call(Closure.java:412)
    at groovy.lang.Closure.call(Closure.java:428)
    at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71)
    at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)
    at org.gradle.util.ConfigureUtil.configureSelf(ConfigureUtil.java:130)
    at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:616)
    at org.gradle.api.DefaultTask.configure(DefaultTask.java:307)
    at org.gradle.api.DefaultTask.configure(DefaultTask.java:44)
    at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:103)
    at org.gradle.util.ConfigureUtil$WrappedConfigureAction.execute(ConfigureUtil.java:166)
    at org.gradle.api.internal.collections.CollectionFilter$1.execute(CollectionFilter.java:59)
    at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:163)
    at org.gradle.api.internal.tasks.DefaultRealizableTaskCollection.all(DefaultRealizableTaskCollection.java:224)
    at org.gradle.api.internal.DefaultDomainObjectCollection.withType(DefaultDomainObjectCollection.java:205)
    at org.gradle.api.internal.DefaultDomainObjectCollection.withType(DefaultDomainObjectCollection.java:211)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl.getMapping(ExternalTestsModelBuilderImpl.groovy:40)
    at org.jetbrains.plugins.gradle.tooling.builder.ExternalTestsModelBuilderImpl.buildAll(ExternalTestsModelBuilderImpl.groovy:29)
    at org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder.buildAll(ExtraModelBuilder.java:115)
    at org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder.buildAll(ExtraModelBuilder.java:80)
    at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$BuilderWithParameter.build(DefaultToolingModelBuilderRegistry.java:192)
    at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$LockSingleProjectBuilder.lambda$build$0(DefaultToolingModelBuilderRegistry.java:211)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectLock$3(DefaultProjectStateRegistry.java:310)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:310)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:291)
    at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$LockSingleProjectBuilder.build(DefaultToolingModelBuilderRegistry.java:211)
    at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$BuildOperationWrappingBuilder$1.call(DefaultToolingModelBuilderRegistry.java:246)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
    at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
    at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$BuildOperationWrappingBuilder.build(DefaultToolingModelBuilderRegistry.java:243)
    at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getModel(DefaultBuildController.java:102)
    at org.gradle.tooling.internal.consumer.connection.ParameterAwareBuildControllerAdapter.getModel(ParameterAwareBuildControllerAdapter.java:39)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.getModel(UnparameterizedBuildController.java:113)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.getModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:97)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:81)
    at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction$MyBuildController.findModel(ProjectImportAction.java:542)
    at org.jetbrains.plugins.gradle.model.ClassSetImportModelProvider.populateProjectModels(ClassSetImportModelProvider.java:39)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.addProjectModels(ProjectImportAction.java:201)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:114)
    at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:41)
    at org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:64)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionRunningListener.runAction(AbstractClientProvidedBuildActionRunner.java:134)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionRunningListener.buildFinished(AbstractClientProvidedBuildActionRunner.java:119)
    at jdk.internal.reflect.GeneratedMethodAccessor766.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:398)
    at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:380)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
    at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:368)
    at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:355)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
    at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:245)
    at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:157)
    at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:61)
    at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:346)
    at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:249)
    at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
    at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
    at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
    at com.sun.proxy.$Proxy19.buildFinished(Unknown Source)
    at org.gradle.initialization.DefaultGradleLauncher.finishBuild(DefaultGradleLauncher.java:196)
    at org.gradle.initialization.DefaultGradleLauncher.finishBuild(DefaultGradleLauncher.java:132)
    at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:72)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
    at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner.runClientAction(AbstractClientProvidedBuildActionRunner.java:53)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:47)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:66)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:90)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
    at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.lambda$execute$0(InProcessBuildActionExecuter.java:59)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:86)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:58)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeScopeLifecycleBuildActionExecuter.java:34)
    at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:53)
    at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:33)
    at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:28)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:104)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:64)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:37)
    at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(SessionScopeLifecycleBuildActionExecuter.java:54)
    at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67)
    at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:50)
    at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:58)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    at java.base/java.lang.Thread.run(Thread.java:834)

Not sure what I have to do to fix this problem.

Here is my gradle-wrapper.properties

#Sat Jul 18 00:44:27 AEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
# https://services.gradle.org/distributions/

Here is build.gradle for the project level:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.5.10'
    // Import the BoM for the Firebase platform: https://firebase.google.com/docs/android/learn-more?authuser=0#bom
    ext.firebase_bom_version = '28.2.0'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.0-beta04'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.8'
        classpath "io.realm:realm-gradle-plugin:6.1.0"

        // https://firebase.google.com/docs/crashlytics/get-started?platform=android&authuser=0#add-sdk
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Here is build.gradle from one of the app:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"
    ndkVersion "21.3.6528147"

    defaultConfig {
        applicationId "com.abc.apps.myapp"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 29
        versionName "6.5"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    buildFeatures {
        viewBinding true
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
}

dependencies {
    implementation platform("com.google.firebase:firebase-bom:$firebase_bom_version")
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':nextgenlib')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'androidx.core:core-ktx:1.5.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-crashlytics-ktx'
    implementation 'com.google.firebase:firebase-messaging-ktx'
}

I hope someone can help me.


问:
C & CXX Compiler Issues - Multiple definitions
Im working on a game that uses SFML. Currently the project uses a CMakeCCCompilerId.c and CMakeCXXCompilerId.cpp in a directory 'CMakeFiles'

I'm getting the following errors below:

```<code>build/Debug/GNU-Linux-x86/_ext/305235777/CMakeCXXCompilerId.o:(.data+0x0): multiple definition of `info_compiler'
build/Debug/GNU-Linux-x86/_ext/1773982079/CMakeCCompilerId.o:(.data+0x0): first defined here
build/Debug/GNU-Linux-x86/_ext/305235777/CMakeCXXCompilerId.o:(.data+0x8): multiple definition of `info_platform'
build/Debug/GNU-Linux-x86/_ext/1773982079/CMakeCCompilerId.o:(.data+0x8): first defined here
build/Debug/GNU-Linux-x86/_ext/305235777/CMakeCXXCompilerId.o:(.data+0x10): multiple definition of `info_arch'
build/Debug/GNU-Linux-x86/_ext/1773982079/CMakeCCompilerId.o:(.data+0x10):  first defined here
build/Debug/GNU-Linux-x86/_ext/305235777/CMakeCXXCompilerId.o: In function `main':
/home/rob/NetBeansProjects/development/projects/sfml- tmxloader/CMakeFiles/2.8.12.2/CompilerIdCXX/CMakeCXXCompilerId.cpp:368: multiple  definition of `main'
 build/Debug/GNU-Linux-x86/_ext/1773982079/CMakeCCompilerId.o:/home/rob/NetBeansProjects/development/projects/sfml-tmxloader/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c:378: first defined here

build/Debug/GNU-Linux-x86/_ext/581045564/Benchmark.o: In function `main':
/home/rob/NetBeansProjects/development/projects/sfml-   tmxloader/examples/Benchmark.cpp:89: multiple definition of `main'
build/Debug/GNU-Linux-x86/_ext/1773982079/CMakeCCompilerId.o:/home/rob/NetBeansProjects/development/projects/sfml-tmxloader/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c:378: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/levelrender] Error 1
make[2]: Leaving directory  `/home/rob/NetBeansProjects/development/projects/LevelRender'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/rob/NetBeansProjects/development/projects/LevelRender'
make: *** [.build-impl] Error 2
</code>```

答:
Had the same issue, fixed by adding CXX to:

```<code>project(project_name CXX)
</code>```

Body:
Im working on a game that uses SFML. Currently the project uses a CMakeCCCompilerId.c and CMakeCXXCompilerId.cpp in a directory 'CMakeFiles'

I'm getting the following errors below:

build/Debug/GNU-Linux-x86/_ext/305235777/CMakeCXXCompilerId.o:(.data+0x0): multiple definition of `info_compiler'
build/Debug/GNU-Linux-x86/_ext/1773982079/CMakeCCompilerId.o:(.data+0x0): first defined here
build/Debug/GNU-Linux-x86/_ext/305235777/CMakeCXXCompilerId.o:(.data+0x8): multiple definition of `info_platform'
build/Debug/GNU-Linux-x86/_ext/1773982079/CMakeCCompilerId.o:(.data+0x8): first defined here
build/Debug/GNU-Linux-x86/_ext/305235777/CMakeCXXCompilerId.o:(.data+0x10): multiple definition of `info_arch'
build/Debug/GNU-Linux-x86/_ext/1773982079/CMakeCCompilerId.o:(.data+0x10):  first defined here
build/Debug/GNU-Linux-x86/_ext/305235777/CMakeCXXCompilerId.o: In function `main':
/home/rob/NetBeansProjects/development/projects/sfml- tmxloader/CMakeFiles/2.8.12.2/CompilerIdCXX/CMakeCXXCompilerId.cpp:368: multiple  definition of `main'
 build/Debug/GNU-Linux-x86/_ext/1773982079/CMakeCCompilerId.o:/home/rob/NetBeansProjects/development/projects/sfml-tmxloader/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c:378: first defined here

build/Debug/GNU-Linux-x86/_ext/581045564/Benchmark.o: In function `main':
/home/rob/NetBeansProjects/development/projects/sfml-   tmxloader/examples/Benchmark.cpp:89: multiple definition of `main'
build/Debug/GNU-Linux-x86/_ext/1773982079/CMakeCCompilerId.o:/home/rob/NetBeansProjects/development/projects/sfml-tmxloader/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c:378: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/levelrender] Error 1
make[2]: Leaving directory  `/home/rob/NetBeansProjects/development/projects/LevelRender'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/rob/NetBeansProjects/development/projects/LevelRender'
make: *** [.build-impl] Error 2

Body:
Had the same issue, fixed by adding CXX to:

project(project_name CXX)