Troubleshooting
This guide helps you diagnose and resolve common issues with Source Push.
Common Issues
Installation Issues
CLI Installation Fails
If you encounter permission errors while installing the CLI, see the CLI Installation guide for setup steps and troubleshooting tips.
SDK Installation Fails
For issues installing the React Native SDK, refer to our React Native SDK Setup. Common fixes include clearing the npm cache and verifying package compatibility.
Authentication Issues
Login Fails
srcpush login
# Error: Authentication failed
Solutions:
-
Check network connection
-
Verify access key:
srcpush whoami
-
Clear credentials:
srcpush logout
srcpush login
Access Key Issues
srcpush login --accessKey <key>
# Error: Invalid access key
Solutions:
-
Generate new key:
srcpush access-key add "New Key"
-
Check key expiration:
srcpush access-key ls
Release Issues
Release Command Fails
srcpush release-react MyApp-iOS ios
# Error: Bundle creation failed
Solutions:
-
Check React Native setup:
react-native -v
-
Verify bundle configuration:
# Check entry file exists
ls index.ios.js || ls index.js -
Manual bundle creation:
react-native bundle --platform ios \
--entry-file index.js \
--bundle-output ./bundle/main.jsbundle \
--dev false
Update Not Appearing
Check deployment status:
srcpush deployment ls MyApp-iOS Production
Solutions:
-
Verify target version:
srcpush deployment history MyApp-iOS Production
-
Check app configuration:
<!-- iOS: Info.plist -->
<key>CodePushDeploymentKey</key>
<string>YOUR-KEY</string>
<!-- Android: strings.xml -->
<string name="CodePushDeploymentKey">YOUR-KEY</string>
Integration Issues
iOS Build Fails
pod install
# Error: Could not find compatible version
Solutions:
-
Update Podfile:
pod 'CodePush', :path => '../node_modules/@srcpush/react-native-code-push'
-
Clean build:
cd ios
pod deintegrate
pod install
Android Build Fails
./gradlew assembleRelease
# Error: Could not find method codePush()
Solutions:
-
Check
android/settings.gradle
:include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/@srcpush/react-native-code-push/android/app') -
Verify
android/app/build.gradle
:apply from: "../../node_modules/@srcpush/react-native-code-push/android/codepush.gradle"
Update Issues
Update Download Fails
codePush.sync({ updateDialog: true });
// Error: Unable to download update
Solutions:
-
Check network connectivity
-
Verify deployment key
-
Enable debug mode:
codePush.enableDebugMode();
-
Check logs:
srcpush debug ios
# or
srcpush debug android
Update Installation Fails
Solutions:
-
Clear app storage
-
Check available storage
-
Verify bundle integrity:
codePush.sync({
installMode: codePush.InstallMode.IMMEDIATE,
mandatoryInstallMode: codePush.InstallMode.IMMEDIATE,
rollbackRetryOptions: {
maxRetryAttempts: 3,
},
});
Rollback Issues
Automatic Rollback
When updates automatically rollback:
-
Check update compatibility:
srcpush deployment history MyApp-iOS Production
-
Enable detailed logging:
codePush.enableDebugMode();
-
Monitor rollback metrics:
srcpush deployment ls MyApp-iOS Production --format detailed
Manual Rollback Fails
srcpush rollback MyApp-iOS Production
# Error: No releases available
Solutions:
-
Check deployment history:
srcpush deployment history MyApp-iOS Production
-
Specify target release:
srcpush rollback MyApp-iOS Production --targetRelease v5
Debug Tools
Enable Debug Mode
// App.js
import codePush from "@srcpush/react-native-code-push";
if (__DEV__) {
codePush.enableDebugMode();
}
View Debug Logs
# iOS
srcpush debug ios
# Android
srcpush debug android
Network Debugging
# Check API connectivity
curl -I https://api.srcpush.com
# Test with proxy
export SRCPUSH_PROXY=http://proxy.company.com
srcpush deployment ls MyApp-iOS
Best Practices
1. Testing Updates
- Test in staging first
- Use multiple devices
- Check different OS versions
- Verify network conditions
2. Monitoring
- Watch error rates
- Track installation success
- Monitor download speeds
- Check user feedback
3. Backup Plans
- Keep rollback versions
- Document procedures
- Test recovery process
- Maintain backup deployments
Getting Help
1. Documentation
- Check API Reference
- Review CLI Reference
- Read Release Notes
2. Support Channels
- GitHub Issues
- Stack Overflow
- Community Forums
- Support Email
3. Debug Information
When seeking help, provide:
- CLI version
- SDK version
- Error messages
- Debug logs
- Reproduction steps