“无法解析net.java.dev.jna:jna-platform&quot&quot&quot当我整合firebase时,在gradle中

发布于 2025-01-24 17:05:09 字数 2375 浏览 0 评论 0原文

错误是:

无法解析net.java.dev.jna:jna-platform

在将火箱集成到Mu grandle的集成中,我遇到了一个错误。我不知道是否是因为文档的结构进行了修改,因为在我的中,它不包含“ buildscript”,“ allprojects”。

我正在使用Java进行编程,而不是在Kotlin进行编程,以防万一可以提供帮助。 我的gradle.app是

 plugins {

    id 'com.android.application'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.whatdowant"
        minSdk 24
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    ///Implement para  FIREBASE
    implementation 'com.google.firebase:firebase-auth:21.0.3'
    implementation 'com.google.android.gms:play-services:play-services-auth:17.0.0'
    implementation 'com.google.firebase:firebase-analytics'
    implementation platform('com.google.firebase:firebase-bom:29.3.1')

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

apply plugin: 'com.google.gms.google-services'



> `My gradle. project is:`



buildscript {
    ext.kotlin_version = "1.5.0"
    repositories {
        // Check that you have the following line (if not, add it):
        google()  // Google's Maven repository
    }

    dependencies {
        // Add the following line:
        classpath 'com.google.gms:google-services:4.3.10'  // Google Services plugin
        classpath "com.android.tools.build:gradle:4.2.2"

    }
}

allprojects {

    repositories {
        mavenCentral()
        google()  // Google's Maven repository


    }
}
```

The error is:

Could not resolve net.java.dev.jna:jna-platform

In the integration of Firebase to mu Grandle I get an error. I don't know if it's because the structure of the document was modified, since in mine it didn't contain "buildscript","allprojects".

I'm programming with java, not with kotlin in case it can help.
My gradle.app is

 plugins {

    id 'com.android.application'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.whatdowant"
        minSdk 24
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    ///Implement para  FIREBASE
    implementation 'com.google.firebase:firebase-auth:21.0.3'
    implementation 'com.google.android.gms:play-services:play-services-auth:17.0.0'
    implementation 'com.google.firebase:firebase-analytics'
    implementation platform('com.google.firebase:firebase-bom:29.3.1')

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

apply plugin: 'com.google.gms.google-services'



> `My gradle. project is:`



buildscript {
    ext.kotlin_version = "1.5.0"
    repositories {
        // Check that you have the following line (if not, add it):
        google()  // Google's Maven repository
    }

    dependencies {
        // Add the following line:
        classpath 'com.google.gms:google-services:4.3.10'  // Google Services plugin
        classpath "com.android.tools.build:gradle:4.2.2"

    }
}

allprojects {

    repositories {
        mavenCentral()
        google()  // Google's Maven repository


    }
}
```

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文