‘android.useAndroidX’ 属性未启用。

huangapple go评论77阅读模式
英文:

'android.useAndroidX' property is not enabled

问题

好的,以下是翻译好的内容:

好的,这是我第一次使用SDK,

我正在使用Zoom SDK,网址在这里:https://marketplace.zoom.us/docs/sdk/native-<img>sdks/android/getting-started</img>

我尝试按照文档中提到的方式运行示例APK,但返回错误信息:“This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled”
https://i.stack.imgur.com/taM6c.png

我已经搜索并找到了解决方法,可以通过在Gradle.properties文件中添加以下内容将Android项目转换为AndroidX项目:

android.useAndroidX=true
android.enableJetifier=true

问题出在这里

该SDK没有Gradle.properties文件,因此我不知道在哪里插入上述代码。目前,我已经将上述代码插入了以下文件:https://i.stack.imgur.com/Ktj4j.png

然而问题仍然存在,我能否请您提前提供一些帮助?谢谢!

英文:

okay, so this is the first time I'm working with SDKs,

I'm using the zoom SDK from here https://marketplace.zoom.us/docs/sdk/native-&lt;img&gt;sdks/android/getting-started&lt;/img>

and I'm trying to run the sample APK as mentioned in the documentation and it returns the error
"This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled"
https://i.stack.imgur.com/taM6c.png

and I have searched and found a solution to this where I turn the android project into an androidX project by using the following in the Gradle.properties file:

android.useAndroidX=true
android.enableJetifier=true

HERE IS WHERE THE ISSUE LIES

the SDK doesn't have any Gradle.properties file, and hence i don't know where to insert the above code
for now, I have inserted the above code in the following files: https://i.stack.imgur.com/Ktj4j.png

and yet the issue still exists, can I please get some help on this? thanks in advance!

答案1

得分: 23

将以下内容添加到 gradle.properties 文件中可以解决我的问题。

android.useAndroidX=true
android.enableJetifier=true
英文:

Added this into gradle.properties files solve my problem.

android.useAndroidX=true
android.enableJetifier=true

答案2

得分: 1

Application level

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: [])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.3.1'
    implementation files('libs/commonlib.aar')
    implementation files('libs/mobilertc.aar')
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.3.0-alpha02'
}

Project Level

dependencies {
    classpath "com.android.tools.build:gradle:4.0.0"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
英文:

Create new project that time no need to convert AndroidX. Add this in gradle, hopefully working.

Application level

dependencies {
    
       implementation fileTree(dir: &#39;libs&#39;, include: [&#39;*.aar&#39;, &#39;*.jar&#39;], exclude: [])
       implementation &quot;org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version&quot;
       implementation &#39;androidx.core:core-ktx:1.3.1&#39;             
       implementation files(&#39;libs/commonlib.aar&#39;)
       implementation files(&#39;libs/mobilertc.aar&#39;)
       testImplementation &#39;junit:junit:4.12&#39;
       androidTestImplementation &#39;androidx.test.ext:junit:1.1.1&#39;
       androidTestImplementation &#39;androidx.test.espresso:espresso-core:3.2.0&#39;
       implementation &#39;androidx.multidex:multidex:2.0.1&#39;
       implementation &#39;androidx.recyclerview:recyclerview:1.1.0&#39;
       implementation &#39;androidx.appcompat:appcompat:1.2.0&#39;
       implementation &#39;androidx.constraintlayout:constraintlayout:1.1.3&#39;
       implementation &#39;com.google.android.material:material:1.3.0-alpha02&#39;     
}

Project Level

dependencies {
     classpath &quot;com.android.tools.build:gradle:4.0.0&quot;
     classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
}

答案3

得分: 1

将以下内容添加到 gradle.properties 文件中:

android.useAndroidX=true
android.enableJetifier=true

如果你没有找到这个文件,在终端中输入 flutter create . 来重新创建你的项目,之后你将会看到具有我之前提到的相同属性的 gradle.properties 文件。

英文:

Added this into gradle.properties files

android.useAndroidX=true
android.enableJetifier=true

if you did not find this file write in the terminal flutter create . to recreate your project after that you are going to see gradle.properties file with the same properties that I mintioned before.

答案4

得分: 0

gradle.properties 文件的名称应为小写,您可以将它放在多个位置,详见官方文档这里
在这种情况下,我猜您需要将它放在项目根目录中。

英文:

The gradle.properties file's name should be lowercase and you can place it multiple location, see the official documentation here.
In this case, I guess you have to put it to your project root directory.

huangapple
  • 本文由 发表于 2020年5月4日 19:24:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/61591089.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定