lucasferreira/react-native-simpledialog-android

Instructions for RN 29?

Closed this issue · 0 comments

Environment:

react-native --version
react-native-cli: 1.0.0
react-native: 0.29.2

After following the instructions for Android, getting the following when running react-native run-android

Building and installing the app on the device (cd android && ./gradlew installDebug...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Cannot evaluate module RNSimpleAlertDialogModule : Configuration with name 'default' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

I think the instructions for Android don't match up. What I mean is it looks like FB changed some things around wrt MainActivity.java and

Here's my initial MainActivity:

package com.snowflake;

import com.facebook.react.ReactActivity;

public class MainActivity extends ReactActivity {
    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "snowflake";
    }
}

And here's the MainApplication:

package com.snowflake;

import android.app.Application;
import android.util.Log;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    protected boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage()
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
      return mReactNativeHost;
  }
}

So I attempted to modify MainApplication w/ the steps documented for MainActivity but that results in error as presented above.

NOTE: the import changes wrt React vs React-Native have already been done for RN 25, see https://github.com/bartonhammond/react-native-simpledialog-android/blob/master/index.js#L7. I'd like to get this merged back in if possible.

Thanks in advance!