hanrui1sensetime / PoseTracker-Android-Prototype

PoseTracker Android Demo Prototype.
Apache License 2.0
21 stars 2 forks source link

在android studio build project 时发生错误 #3

Open kdavidlp123 opened 1 year ago

kdavidlp123 commented 1 year ago

您好,我想请问一下,我按照您的步骤对mmdeploy进行交叉编译后,在android studio执行build发生这个错误,是因为使用不同java版本编译的关系吗

A problem occurred configuring root project 'PoseTracker'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:7.4.2.
     Required by:
         project :
      > No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.4' but:
          - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.4')
          - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.4')
          - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.4')
          - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.4')

以下是我的版本:

(base) david@david-System-Product-Name:~/android-studio/bin$ sudo update-alternatives --config javac
[sudo] password for david: 
There is only one alternative in link group javac (providing /usr/bin/javac): /home/david/jdk-18/bin/javac
Nothing to configure.
(base) david@david-System-Product-Name:~/android-studio/bin$ sudo update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /home/david/jdk-18
Nothing to configure.