6

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

我从这里使用缩放 SDK https://marketplace.zoom.us/docs/sdk/native-sdks/android/getting-started

我正在尝试运行文档中提到的示例 apk,它返回错误“此项目使用 AndroidX 依赖项,但未启用 'android.useAndroidX' 属性” 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

但是问题仍然存在,我可以得到一些帮助吗?提前致谢!

4

3 回答 3

14

将此添加到gradle.properties文件中解决了我的问题。

android.useAndroidX=true
android.enableJetifier=true
于 2020-11-03T01:40:12.633 回答
1
 Create new project that time no need to convert AndroidX. Add this in gradle, hopefully working.

应用层

 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'
    
    }

项目级别

 dependencies {
        classpath "com.android.tools.build:gradle:4.0.0"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
于 2020-08-06T04:35:07.253 回答
0

gradle.properties文件名应为小写,您可以将其放置多个位置,请参阅此处的官方文档。在这种情况下,我猜你必须把它放到你的项目根目录中。

于 2020-05-04T11:45:11.353 回答