Ошибка сборки: невозможно обработать входящее событие 'ProgressComplete' - PullRequest
0 голосов
/ 21 мая 2019

Я правильно строю свой проект React Native, работая в режиме отладки, но не могу добиться успеха, когда пытаюсь построить свой проект в режиме выпуска.

Некоторая информация о проекте:

Версия RN: 0.55.4

версия gradle: 2.2.3

compileSdkVersion 26

buildToolsVersion«26.0.3»

ОС: Windows 10

Хотя я попробовал все предложения по следующей ссылке React Native APK build build Не удалось обработать входящее событие 'ProgressComplete' iне может достичь хороших результатов

например:

реактивный запуск android --variant = release

gradlew сборкаRelease --console plain

ect.

android / build.gradle ::


buildscript {
   repositories {
       jcenter()
       maven { url 'https://maven.google.com' }
   }
   dependencies {
       classpath 'com.android.tools.build:gradle:2.2.3'
       classpath 'com.google.gms:google-services:3.2.0'
       // NOTE: Do not place your application dependencies here; they belong
       // in the individual module build.gradle files
   }
}

allprojects {

   repositories {
       mavenLocal()
       maven { url 'https://maven.google.com' }
       maven { url "https://jitpack.io" }
       jcenter()
       maven {
           // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
           url "$rootDir/../node_modules/react-native/android"
       }
       maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
   }
}

subprojects {
   afterEvaluate {
       project -> if (project.hasProperty("android")) {
           android {
               compileSdkVersion 26
               buildToolsVersion '26.0.1'
           }
       }
   }
}



и app / build.gradle:


apply plugin: "com.android.application"
import com.android.build.OutputFile
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"


def enableSeparateBuildPerCPUArchitecture = true


def enableProguardInReleaseBuilds = false

android {


   signingConfigs {
       config {
           keyAlias '*'
           keyPassword '*!'
           storeFile file('*')
           storePassword '*!'
       }
       release {

           if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
               storeFile file(MYAPP_RELEASE_STORE_FILE)
               storePassword MYAPP_RELEASE_STORE_PASSWORD
               keyAlias MYAPP_RELEASE_KEY_ALIAS
               keyPassword MYAPP_RELEASE_KEY_PASSWORD
           }
       }
   }


   compileSdkVersion 26
   buildToolsVersion "26.0.3"

   defaultConfig {
       applicationId "*"
       minSdkVersion 16
       targetSdkVersion 26
       versionCode 91
       versionName "0.91"
       multiDexEnabled = true

       ndk {
           abiFilters "armeabi-v7a", "x86", "arm64-v8a"
       }
   }

   aaptOptions.cruncherEnabled = false
   aaptOptions.useNewCruncher = false

   splits {
       abi {
           reset()
           enable enableSeparateBuildPerCPUArchitecture
           include "armeabi-v7a", "x86"
       }
   }
   buildTypes {
       release {
           minifyEnabled enableProguardInReleaseBuilds
           proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
           signingConfig signingConfigs.release
           minifyEnabled true
       }
       debug {
           signingConfig signingConfigs.config
       }
   }
   // applicationVariants are e.g. debug, release
   applicationVariants.all { variant ->
       variant.outputs.each { output ->

           def versionCodes = ["armeabi-v7a":1, "x86":2]
           def abi = output.getFilter(OutputFile.ABI)
           if (abi != null) {  // null for the universal-debug, universal-release variants
               output.versionCodeOverride =
                       versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
           }
       }
   }
}

dependencies {
   compile project(':react-native-version-check')
   compile fileTree(dir: "libs", include: ["*.jar"])
   compile "org.jsoup:jsoup:1.8.3"
   compile "com.android.support:appcompat-v7:26.1.0"
   compile "com.facebook.react:react-native:0.55.4" // From node_modules
}

configurations.all {
   resolutionStrategy.eachDependency { DependencyResolveDetails details ->
       def requested = details.requested
       if (requested.group == 'com.android.support') {
           if (!requested.name.startsWith("multidex")) {
               details.useVersion '25.3.0'
           }
       }
   }
}


task copyDownloadableDepsToLibs(type: Copy) {
   from configurations.compile
   into 'libs'
}

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




Еще одна деталь в том, что мы можем построить один и тот же проект свыше gradles на MAC OS, но на окнах он не может быть построен таким же образом.

...