有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

如何修复离子图像获取器。Android版本的java:293错误?

当我运行ionic cordova run 安卓 --device时,我得到以下错误:

皮棉在2.68秒内完成

/Users/me/Sites/my_app/platforms/安卓/app/src/main/java/com/synconset/ImageFetcher.java:293: error: Entry is not public in LinkedHashMap; cannot be accessed from outside package

        protected boolean removeEldestEntry(LinkedHashMap.Entry<Integer, Bitmap> eldest) {
                                                         ^
Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.


BUILD FAILED in 1s
27 actionable tasks: 1 executed, 26 up-to-date
/Users/me/Sites/my_app/platforms/安卓/gradlew: Command failed with exit code 1 Error output:
/Users/me/Sites/my_app/platforms/安卓/app/src/main/java/com/synconset/ImageFetcher.java:293: error: Entry is not public in LinkedHashMap; cannot be accessed from outside package
        protected boolean removeEldestEntry(LinkedHashMap.Entry<Integer, Bitmap> eldest) {
                                                         ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

这是我的安卓build.gradle

buildscript {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }
    dependencies {

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.安卓.tools.build:gradle:3.0.1'
    }
}

allprojects {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }
    //This replaces project.properties w.r.t. build settings
    project.ext {
      defaultBuildToolsVersion="27.0.1" //String
      defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
      defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default
      defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

以下是我所做的事情:

我将defaultCompileSdkVersion27更改为28相同的结果

我补充说

configurations.all {
    resolutionStrategy {
        force 'com.安卓.support:support-v4:27.1.0'
    }
}

build.gradle的底部

我删除了构建并重新安装,同样的错误

我别无选择

提前谢谢你的帮助

我的Gradle版本:

 Gradle 4.10.2
    Build time:   2018-09-19 18:10:15 UTC
    Revision:     b4d8d5d170bb4ba516e88d7fe5647e2323d791dd

    Kotlin DSL:   1.0-rc-6
    Kotlin:       1.2.61
    Groovy:       2.4.15
    Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
    JVM:          1.8.0_25 (Oracle Corporation 25.25-b02)
    OS:           Mac OS X 10.14.1 x86_64

共 (0) 个答案