Использование Flavors для создания различных APK с помощью React Native и AndroidAndroid

Форум для тех, кто программирует под Android
Ответить
Гость
 Использование Flavors для создания различных APK с помощью React Native и Android

Сообщение Гость »


I am trying to create different APKs using flavors in an Android app written with React Native but I am getting the following error while running the

Код: Выделить всё

.gradlew assembleRelease
or any other combination:

Код: Выделить всё

Could not find method applicationIdSuffix() for arguments [.free] on ProductFlavor_Decorated{name=free, dimension=null, minSdkVersion=null, targetSdkVersion=null, renderscriptTargetApi=null, renderscriptSupportModeEnabled=null, renderscriptNdkModeEnabled=null, versionCode=null, versionName=null, applicationId=null, testApplicationId=null, testInstrumentationRunner=null, testInstrumentationRunnerArguments={}, testHandleProfiling=null, testFunctionalTest=null, signingConfig=null, resConfig=null, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}}. 

Изображение


When I remove the

Код: Выделить всё

productFlavors
build process works correct.

Код: Выделить всё

build.gradle
file looks like the following:

Код: Выделить всё

android {     compileSdkVersion 23     buildToolsVersion "23.0.1"     defaultConfig {         applicationId "com.myapp"         minSdkVersion 16         targetSdkVersion 22         versionCode 27         versionName "3.3.1"         ndk {             abiFilters "armeabi-v7a", "x86"         }     }     productFlavors {         free {             applicationIdSuffix ".free"         }         pro {             applicationIdSuffix ".pro"         }     }     ... } 
The content of the

Код: Выделить всё

gradle-wrapper.properties
is as following:

Код: Выделить всё

distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 
Don't have any any clue what's wrong. Any idea what I am missing? Also I am using

Код: Выделить всё

Webstorm
as IDE cause I am working on a ReactNative Project and I mostly work on JS code, would things get easier especially about android configuration if I work with

Код: Выделить всё

AndroidStudio

Thanks


Источник: https://stackoverflow.com/questions/418 ... nd-android
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»