在gradle文件中,由于与行不兼容,我无法编译项目
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicLong;
class FizzBuzz {
protected AtomicLong num = new AtomicLong(1);
protected AtomicLong n = new AtomicLong(100);
protected Semaphore sem1 = new Semaphore(1);
protected Semaphore sem2 = new Semaphore(1);
protected Semaphore sem3 = new Semaphore(1);
protected Semaphore sem4 = new Semaphore(1);
public void start() {
System.out.println("Started");
try {
sem1.acquire();
sem2.acquire();
sem3.acquire();
sem4.acquire();
this.fizz();
this.buzz();
this.fizzBuzz();
this.printNumber();
sem1.release();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public void fizz() {
new Thread() {
@Override
public void run() {
while (num.get() <= n.get()) {
try {
// System.out.println("Fizz waiting...");
sem1.acquire();
sem1.release();
if (num.get() > n.get()) {
break;
}
if (num.get() % 3 == 0 && num.get() % 5 != 0) {
num.getAndIncrement();
System.out.println("Fizz");
}
sem1.acquire();
sem2.release();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}.start();
}
public void buzz() {
new Thread() {
@Override
public void run() {
while (num.get() <= n.get()) {
try {
// System.out.println("Buzz waiting...");
sem2.acquire();
sem2.release();
if (num.get() > n.get()) {
break;
}
if (num.get() % 5 == 0 && num.get() % 3 != 0) {
num.getAndIncrement();
System.out.println("Buzz");
}
sem2.acquire();
sem3.release();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}.start();
}
public void fizzBuzz() {
new Thread() {
@Override
public void run() {
while (num.get() <= n.get()) {
try {
// System.out.println("FizzBuzz waiting...");
sem3.acquire();
sem3.release();
if (num.get() > n.get()) {
break;
}
if (num.get() % 3 == 0 && num.get() % 5 == 0) {
num.getAndIncrement();
System.out.println("FizzBuzz");
}
sem3.acquire();
sem4.release();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}.start();
}
public void printNumber() {
new Thread() {
@Override
public void run() {
while (num.get() <= n.get()) {
try {
// System.out.println("Print Number waiting...");
sem4.acquire();
sem4.release();
if (num.get() > n.get()) {
break;
}
if (num.get() % 3 == 1 && num.get() % 5 == 1) {
num.getAndIncrement();
System.out.println(num);
}
sem4.acquire();
sem1.release();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}.start();
}
}
为解决此问题,我尝试将其修改为v7:28.0.0 ..,但未能解决问题 请让我知道如何解决
代码:
$ cat test.c
void main()
{
__asm__(".byte 0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00");
}
$ gcc -masm=intel -g -c test.c
$ objdump -d -M intel -S test.o
test.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <main>:
void main()
{
0: 55 push rbp
1: 48 89 e5 mov rbp,rsp
...
10: 00 00 add BYTE PTR [rax],al
12: 00 5d c3 add BYTE PTR [rbp-0x3d],bl
$
更新:
在其中一个类别中,我有以下进口商品:
implementation 'com.android.support:appcompat-v7:27.0.0'
答案 0 :(得分:0)
由于最近对gradle 5.1版和androidx库进行了兼容性更新,因此,如果您尚未更新android studio,建议您对其进行更新,请尝试一下
答案 1 :(得分:0)
尝试使用类路径进行依赖项声明而不是实现:
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE")