Skip to main content

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:

  1. Check network connection

  2. Verify access key:

    srcpush whoami
  3. Clear credentials:

    srcpush logout
    srcpush login

Access Key Issues

srcpush login --accessKey <key>
# Error: Invalid access key

Solutions:

  1. Generate new key:

    srcpush access-key add "New Key"
  2. Check key expiration:

    srcpush access-key ls

Release Issues

Release Command Fails

srcpush release-react MyApp-iOS ios
# Error: Bundle creation failed

Solutions:

  1. Check React Native setup:

    react-native -v
  2. Verify bundle configuration:

    # Check entry file exists
    ls index.ios.js || ls index.js
  3. 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:

  1. Verify target version:

    srcpush deployment history MyApp-iOS Production
  2. 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:

  1. Update Podfile:

    pod 'CodePush', :path => '../node_modules/@srcpush/react-native-code-push'
  2. Clean build:

    cd ios
    pod deintegrate
    pod install

Android Build Fails

./gradlew assembleRelease
# Error: Could not find method codePush()

Solutions:

  1. 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')
  2. 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:

  1. Check network connectivity

  2. Verify deployment key

  3. Enable debug mode:

    codePush.enableDebugMode();
  4. Check logs:

    srcpush debug ios
    # or
    srcpush debug android

Update Installation Fails

Solutions:

  1. Clear app storage

  2. Check available storage

  3. Verify bundle integrity:

    codePush.sync({
    installMode: codePush.InstallMode.IMMEDIATE,
    mandatoryInstallMode: codePush.InstallMode.IMMEDIATE,
    rollbackRetryOptions: {
    maxRetryAttempts: 3,
    },
    });

Rollback Issues

Automatic Rollback

When updates automatically rollback:

  1. Check update compatibility:

    srcpush deployment history MyApp-iOS Production
  2. Enable detailed logging:

    codePush.enableDebugMode();
  3. Monitor rollback metrics:

    srcpush deployment ls MyApp-iOS Production --format detailed

Manual Rollback Fails

srcpush rollback MyApp-iOS Production
# Error: No releases available

Solutions:

  1. Check deployment history:

    srcpush deployment history MyApp-iOS Production
  2. 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

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

Next Steps

  1. Set up monitoring
  2. Configure metrics
  3. Learn about deployment strategies