我正在从GitHub克隆一个android类(class)项目,并且遇到了一系列错误,我努力解决了其中的一些问题,直到遇到最后一个错误为止,情况如下:
1-错误:找不到com.android.support:appcompat-v7:25.1.0。 (解决了)。
2错误:模块根文件夹中缺少文件google-services.json。没有它,Google Services插件将无法运行。(已解决)
3错误:无法通过CompileOptions.compilerArgs指定-processorpath或--processor-path。请改用CompileOptions.annotationProcessorPath属性。
我无法修复Error snip
然后添加此实现(
实现“com.google.firebase:firebase-core:17.4.3”),我也收到该错误。

  • 错误:此项目使用AndroidX依赖项,但未启用'android.useAndroidX'属性。在gradle.properties文件中将此属性设置为true,然后重试。
    Error snip
  • 最佳答案

    我发现该链接已对问题中提到的错误进行了精确修复。
    Cannot specify -processorpath or --processor-path via `CompileOptions.compilerArgs`
    解。

    Delete “apply plugin: ‘android-apt’” line from your app module build.gradle file.
    (Not necessary to work) Delete “classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.2’” from your top-level build.gradle file.
    In “dependencies” section in build.gradle rename
    apt ‘net.simonvt.schematic:schematic-compiler:0.6.3’
    to
    annotationProcessor ‘net.simonvt.schematic:schematic-compiler:0.6.3’
    I’m using newest 26.0.2 buildToolsVersion as well as newest support libraries and everything works like a charm.
    Remember to use newest gradle (4.1-all for now) and gradle plugin (3.0.0 for now). Add google repository to download newest support libraries. Sync and rebuild project. Now when you go to your manifest file, there should be no more red android:name=".provider.generated.SquawkProvider"
    
    My top-level build.gradle:
    
    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
    repositories {
    jcenter()
    }
    dependencies {
    classpath ‘com.android.tools.build:gradle:3.0.0’
    
        // Google Services plugin
        classpath 'com.google.gms:google-services:3.1.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
    }
    
    allprojects {
    repositories {
    jcenter()
    google()
    }
    }
    
    task clean(type: Delete) {
    delete rootProject.buildDir
    }
    
    让我知道是否有效。

    关于firebase - 无法通过 `CompileOptions.compilerArgs`指定-processorpath或--processor-path。使用 `CompileOptions.annotationProcessorPath`属性代替,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/62542913/

    10-09 09:18