Gradle build Error:Cause: org.gradle.api.internal.ExtensibleDynamicObject

后端 未结 3 1574
太阳男子
太阳男子 2021-01-17 11:28

I am trying to import \'https://code.google.com/p/android-serialport-api/\'into Android Studio. Since this project involves ndk, I followed the instructions to build NDK fro

3条回答
  •  孤街浪徒
    2021-01-17 12:08

    Unfortunately the NDK preview implementation to support native code development in Android Studio is a moving target. Even if you use an older, developers.android.com stated, "supported" combination of the experimental Android Gradle plugin (from tools.android.com) and Gradle version (from gradle.org), good luck in getting the build to work. Instead, always use the latest released combination with the latest indicated module build.gradle language syntax, according to developers.android.com.

    In your case, your mixing the use of assignment operators, "=" and "+=". Depending on the supported combo of gradle plugin and gradle version you're using, it's either use the assignment operators everywhere in module build.gradle file or nowhere - you have to be consistent, all or nothing. For "+=" use the method ".add(...)" instead.

    And remember, the gradle scripting language is compiled to the Java runtime so when you see a build error that looks like a Java error, it's the gradle scripting that is likely the problem.

提交回复
热议问题