-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Cannot build if we specify Deployment Key - Android #1234
Description
Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):
Hello
I would like to ask if anybody face the same issues. I did all the steps in Multi deployment test for Android. I got an error when trying to generate release version of the product
Here's my code
...
buildTypes {
debug {
buildConfigField "String", "CODEPUSH_KEY", '""'
}
releaseStaging {
minifyEnabled enableProguardInReleaseBuilds = false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
buildConfigField "String", "CODEPUSH_KEY", CODEPUSH_DEPLOYMENT_KEY_STAGING
}
release {
minifyEnabled enableProguardInReleaseBuilds = false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
buildConfigField "String", "CODEPUSH_KEY", CODEPUSH_DEPLOYMENT_KEY_PROD
}
}
...
app.gradle
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG),
new AppCenterReactNativeCrashesPackage(MainApplication.this, getResources().getString(R.string.appCenterCrashes_whenToSendCrashes)),
new AppCenterReactNativeAnalyticsPackage(MainApplication.this, getResources().getString(R.string.appCenterAnalytics_whenToEnableAnalytics)),
...
MainApplication.java
I deploy my APK using either of this command
export ENVFILE=.env && cd android && ./gradlew assembleReleaseStaging && cd../
or
export ENVFILE=.env && cd android && ./gradlew assembleRelease && cd ../
And it produces error like this
/Users/kevindave/Documents/Yumbox/yumboxapp/android/app/src/main/java/com/yummycorp/yumbox/MainApplication.java:13: error: cannot find symbol
import io.invertase.firebase.RNFirebasePackage;
^
symbol: variable YZadGizVZt3SARGloOSsOzzAyo6fSJEhLF0uM
location: class BuildConfig
1 error
:app:compileDebugJavaWithJavac 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.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
The debug mode works. But if I put any deployment key in the debug build types, it produce the same error also
The error is one line below all the app center package import. So there's nothing to do with the RNFirebasePackage. Everything works fine before.
Before implementing multi-deployment test, Code-Push works well and I can download the updates remotely to my Android.
Please help
Thanks
- react-native-code-push version: 5.2.2
- react-native version: 0.47.2
- Android
- Release Build
- Simulator