首页 > 解决方案 > gradle assembleRelease - 在 Windows 上构建 APK 失败

问题描述

使用以下教程创建 APK,但得到BUILD FAILED,附上日志

React Native 项目安装:( “bulls-n-co”是项目文件夹名称)

npm install -g expo-cli
expo init bulls-n-co
cd bulls-n-co
npm start

创建 APK - 重现步骤:

  1. 以管理员模式运行 CMD
  2. cd c:\Program Files\Java\jdk1.8.0_181\bin

    keytool -genkey -v -keystore release-key.keystore -alias key-alias -keyalg RSA -keysize 2048 -validity 10000

  3. 在此文件夹中生成的 release-key.keystore

  4. 公牛-n-co> npm 运行弹出 (“公牛-n-co”是项目文件夹名称)
  5. release-key.keystore复制到bulls -n-co/android/app文件夹
  6. 公牛-n-co> npm i -g react-native-cli
  7. 公牛-n-co> react-native 链接
  8. 在 Bulls-n-co/ gradle.properties文件更新中,注释以下行

org.gradle.configureondemand=true

  1. 在 bulls-n-co/ gradle.properties文件中添加

MYAPP_RELEASE_STORE_FILE=release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=key-alias
MYAPP_RELEASE_STORE_PASSWORD=123456
MYAPP_RELEASE_KEY_PASSWORD=123456

  1. 更新文件 Bulls-n-co/app/build.gradle

...
android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
            if (project.hasProperty('release-key.keystore')) {
                storeFile file(release-key.keystore)
                storePassword 123456
                keyAlias key-alias
                keyPassword 123456
            }
        }
    }
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
}
...

  1. 下载gradle
  2. 解压到 C:\Gradle
  3. 打开环境变量(在 windows 中搜索)并将“C:\Gradle\bin”添加到“Path”
  4. 公牛-n-co\android> gradle assembleRelease

日志:

> Configure project :app
AWS Device Farm Plugin version 1.3

Installing unimodules:
 unimodules-core@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\@unimodules\core
 unimodules-react-native-adapter@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\@unimodules\react-native-adapter
 expo-ads-admob@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-ads-admob
 expo-ads-facebook@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-ads-facebook
 expo-analytics-amplitude@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-analytics-amplitude
 expo-analytics-segment@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-analytics-segment
 expo-app-auth@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-app-auth
 expo-app-loader-provider@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-app-loader-provider
 expo-av@5.0.2 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av
 expo-background-fetch@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-background-fetch
 expo-barcode-scanner@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-barcode-scanner
 expo-brightness@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-brightness
 expo-calendar@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-calendar

 ... partially removed ...

 expo-sharing@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-sharing
 expo-sms@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-sms
 expo-speech@5.0.2 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-speech
 expo-sqlite@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-sqlite
 expo-task-manager@5.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-task-manager
 expo-web-browser@5.0.2 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-web-browser
 unimodules-barcode-scanner-interface@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\unimodules-barcode-scanner-interface
 unimodules-camera-interface@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\unimodules-camera-interface
 unimodules-constants-interface@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\unimodules-constants-interface
 unimodules-file-system-interface@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\unimodules-file-system-interface
 unimodules-font-interface@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\unimodules-font-interface
 unimodules-image-loader-interface@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\unimodules-image-loader-interface
 unimodules-permissions-interface@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\unimodules-permissions-interface
 unimodules-sensors-interface@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\unimodules-sensors-interface
 unimodules-task-manager-interface@2.0.1 from E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\unimodules-task-manager-interface
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variantOutput.getProcessManifest()' is obsolete and has been replaced with 'variantOutput.getProcessManifestProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessManifest(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variant.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getPackageApplication(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Task :app:exponentPrebuildStep

E:\projects\_REACT_NATIVE\bulls-n-co>SET /P STOREDPATH= 0<"C:\Users\Pumych\.expo\PATH"

E:\projects\_REACT_NATIVE\bulls-n-co>SET PATH="\"C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin;C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\Library\usr\bin;C:\ProgramData\An
aconda3\Library\bin;C:\ProgramData\Anaconda3\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C
:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_152\bin;C:\WINDOWS\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\Java\
jdk1.8.0_181\bin;C:\Users\Pumych\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\PuTTY\;E:\downloads\geckodriver-v0.23.0-win64;c:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\1
10\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Users\Pumych\AppData\Local\Microsoft\WindowsApps;c:\Program Files (x86)\Microsoft
 VS Code\bin;C:\Users\Pumych\AppData\Local\Programs\Python\Python36-32;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Users\Pumych\AppData\Roaming\nvm;C:\Program Files\nodejs;E:\downloads\geckodriver-v0.23.0-win64;C:\Gradle\bin;;C:\ProgramData\Anaconda3\node_modules\npm
\node_modules\npm-lifecycle\node-gyp-bin;E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\.bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin;C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Library\mingw-w64\bin;C:\ProgramD
ata\Anaconda3\Library\usr\bin;C:\ProgramData\Anaconda3\Library\bin;C:\ProgramData\Anaconda3\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA
 Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_152\bin;C:\WINDOWS\System32\OpenSSH\;C:\Pr
ogramData\chocolatey\bin;C:\Program Files\Java\jdk1.8.0_181\bin;C:\Users\Pumych\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\PuTTY\;E:\downloads\geckodriver-v0.23.0-win64;\""

E:\projects\_REACT_NATIVE\bulls-n-co>expo

  Usage: expo [options] [command]

  Options:

    -V, --version                                       output the version number
    -o, --output [format]                               Output format. pretty (default), raw
    --non-interactive                                   Fail, if an interactive prompt would be required to continue. Enabled by default if stdin is not a TTY.
    -h, --help                                          output usage information

  Commands:

    android [options] [project-dir]                     Opens your app in Expo on a connected Android device
    ... partially removed ...
    ios [options] [project-dir]                         Opens your app in Expo in an iOS simulator on your computer
    login|signin [options]                              Login with your Expo account
    logout                                              Logout from your Expo account
    opt-in-google-play-signing [options] [project-dir]  Switch from the old method of signing APKs to the new App Signing by Google Play. The APK will be signed with an upload key and after uploading it to the store, app will be re-signed with the key from the orig
inal keystore.
    optimize|o [options] [project-dir]                  Compress the assets in your Expo project
    prepare-detached-build [options] [project-dir]      Prepares a detached project for building
    publish:history|ph [options] [project-dir]          View a log of your published releases.
    publish:details|pd [options] [project-dir]          View the details of a published release.
    publish:set|ps [options] [project-dir]              Set a published release to be served from a specified channel.
    publish:rollback|pr [options] [project-dir]         Rollback an update to a channel.
    publish|p [options] [project-dir]                   Publishes your project to exp.host
    push:android:upload [options] [project-dir]         Uploads a Firebase Cloud Messaging key for Android push notifications.
    push:android:show [options] [project-dir]           Print the value currently in use for FCM notifications for this project.
    push:android:clear [options] [project-dir]          Deletes a previously uploaded FCM credential.
    register                                            Sign up for a new Expo account
    send [options] [project-dir]                        Sends a link to your project to an email address
    start|r [options] [project-dir]                     Starts or restarts a local server for your app and gives you a URL to it
    upload:android|ua [options] [projectDir]            Uploads a standalone Android app to Google Play (works on macOS only). Uploads the latest build by default.
    upload:ios|ui [options] [projectDir]                Uploads a standalone app to Apple TestFlight (works on macOS only). Uploads the latest build by default.
    url|u [options] [project-dir]                       Displays the URL you can use to view your project in Expo
    url:ipa [options] [project-dir]                     Displays the standalone iOS binary URL you can use to download your app binary
    url:apk [options] [project-dir]                     Displays the standalone Android binary URL you can use to download your app binary
    webhooks:set [options] [project-dir]                Set a webhook for the project.
    webhooks:show [options] [project-dir]               Show webhooks for the project.
    webhooks:clear [options] [project-dir]              Clear a webhook associated with this project.
    whoami|w                                            Checks with the server and then says who you are logged in as

[10:27:51] To learn more about a specific command and its options use 'expo [command] --help'


> Task :unimodules-core:compileReleaseJavaWithJavac
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :expo-app-loader-provider:compileReleaseJavaWithJavac
Note: E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-app-loader-provider\android\src\main\java\expo\loaders\provider\AppLoaderProvider.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :app:processReleaseGoogleServices
Parsing json file: E:\projects\_REACT_NATIVE\bulls-n-co\android\app\google-services.json

> Task :expo-app-auth:compileReleaseJavaWithJavac
Note: E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-app-auth\android\src\main\java\expo\modules\appauth\AppAuthModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :expo-av:compileReleaseJavaWithJavac FAILED
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\video\VideoView.java:6: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\video\VideoViewWrapper.java:5: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\video\FullscreenVideoPlayerPresentationChangeProgressListener.java:3: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\video\FullscreenVideoPlayer.java:6: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\PlayerDataControl.java:4: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\datasource\CustomHeadersOkHttpDataSourceFactory.java:3: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\datasource\CustomHeadersOkHttpDataSourceFactory.java:4: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\MediaPlayerData.java:10: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
                                 ^
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\SimpleExoPlayerData.java:7: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\video\VideoView.java:66: error: cannot find symbol
  public VideoView(@NonNull Context context, VideoViewWrapper videoViewWrapper, ModuleRegistry moduleRegistry) {
                    ^
  symbol:   class NonNull
  location: class VideoView
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\video\VideoViewWrapper.java:20: error: cannot find symbol
  public VideoViewWrapper(@NonNull Context context, ModuleRegistry moduleRegistry) {
                           ^
  symbol:   class NonNull
  location: class VideoViewWrapper
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\video\FullscreenVideoPlayerPresentationChangeProgressListener.java:22: error: cannot find symbol
  void onFullscreenPlayerPresentationError(@Nullable String errorMessage) {}
                                            ^
  symbol:   class Nullable
  location: class FullscreenVideoPlayerPresentationChangeProgressListener
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\video\FullscreenVideoPlayer.java:60: error: cannot find symbol
  FullscreenVideoPlayer(@NonNull Context context, VideoView videoView, ModuleRegistry moduleRegistry) {
                         ^
  symbol:   class NonNull
  location: class FullscreenVideoPlayer
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\PlayerDataControl.java:10: error: cannot find symbol
  public PlayerDataControl(final @NonNull PlayerData playerData) {
                                  ^
  symbol:   class NonNull
  location: class PlayerDataControl
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\datasource\CustomHeadersOkHttpDataSourceFactory.java:19: error: cannot find symbol
  @NonNull
   ^
  symbol:   class NonNull
  location: class CustomHeadersOkHttpDataSourceFactory
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\datasource\CustomHeadersOkHttpDataSourceFactory.java:21: error: cannot find symbol
  @Nullable
   ^
  symbol:   class Nullable
  location: class CustomHeadersOkHttpDataSourceFactory
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\datasource\CustomHeadersOkHttpDataSourceFactory.java:23: error: cannot find symbol
  @Nullable
   ^
  symbol:   class Nullable
  location: class CustomHeadersOkHttpDataSourceFactory
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\datasource\CustomHeadersOkHttpDataSourceFactory.java:25: error: cannot find symbol
  @Nullable
   ^
  symbol:   class Nullable
  location: class CustomHeadersOkHttpDataSourceFactory
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\datasource\CustomHeadersOkHttpDataSourceFactory.java:28: error: cannot find symbol
  public CustomHeadersOkHttpDataSourceFactory(@NonNull Call.Factory callFactory, @Nullable String userAgent, @Nullable Map<String, Object> requestHeaders) {
                                               ^
  symbol:   class NonNull
  location: class CustomHeadersOkHttpDataSourceFactory
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\datasource\CustomHeadersOkHttpDataSourceFactory.java:28: error: cannot find symbol
  public CustomHeadersOkHttpDataSourceFactory(@NonNull Call.Factory callFactory, @Nullable String userAgent, @Nullable Map<String, Object> requestHeaders) {
                                                                                  ^
  symbol:   class Nullable
  location: class CustomHeadersOkHttpDataSourceFactory
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\datasource\CustomHeadersOkHttpDataSourceFactory.java:28: error: cannot find symbol
  public CustomHeadersOkHttpDataSourceFactory(@NonNull Call.Factory callFactory, @Nullable String userAgent, @Nullable Map<String, Object> requestHeaders) {
                                                                                                              ^
  symbol:   class Nullable
  location: class CustomHeadersOkHttpDataSourceFactory
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\datasource\CustomHeadersOkHttpDataSourceFactory.java:37: error: cannot find symbol
  protected void updateRequestProperties(HttpDataSource.RequestProperties requestProperties, @Nullable Map<String, Object> requestHeaders) {
                                                                                              ^
  symbol:   class Nullable
  location: class CustomHeadersOkHttpDataSourceFactory
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\MediaPlayerData.java:159: error: cannot find symbol
  @RequiresApi(api = Build.VERSION_CODES.M)
   ^
  symbol:   class RequiresApi
  location: class MediaPlayerData
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\SimpleExoPlayerData.java:385: error: cannot find symbol
  public void onLoadStarted(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {
                                              ^
  symbol:   class Nullable
  location: class SimpleExoPlayerData
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\SimpleExoPlayerData.java:390: error: cannot find symbol
  public void onLoadCompleted(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {
                                                ^
  symbol:   class Nullable
  location: class SimpleExoPlayerData
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\SimpleExoPlayerData.java:395: error: cannot find symbol
  public void onLoadCanceled(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {
                                               ^
  symbol:   class Nullable
  location: class SimpleExoPlayerData
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\SimpleExoPlayerData.java:400: error: cannot find symbol
  public void onLoadError(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException error, boolean wasCanceled) {
                                            ^
  symbol:   class Nullable
  location: class SimpleExoPlayerData
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\SimpleExoPlayerData.java:415: error: cannot find symbol
  public void onDownstreamFormatChanged(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData) {
                                                          ^
  symbol:   class Nullable
  location: class SimpleExoPlayerData
E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\video\VideoManager.java:76: error: cannot find symbol
          void onFullscreenPlayerPresentationError(@Nullable String errorMessage) {
                                                    ^
  symbol: class Nullable
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: E:\projects\_REACT_NATIVE\bulls-n-co\node_modules\expo-av\android\src\main\java\expo\modules\av\player\PlayerData.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
29 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':expo-av:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 27s
418 actionable tasks: 402 executed, 16 up-to-date

标签: javaandroidreact-nativegradleapk

解决方案


推荐阅读