Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get to work in Android 23 #24

Closed
sergiopvilar opened this issue Oct 9, 2016 · 3 comments
Closed

Can't get to work in Android 23 #24

sergiopvilar opened this issue Oct 9, 2016 · 3 comments

Comments

@sergiopvilar
Copy link

Hey there, I just folowed those steps in README but I can't get the app to run in Android.

Tha'ts the error I got:

:app:compileDebugJavaWithJavac
/Users/myuser/MyApp/android/app/src/main/java/com/anansimobile/MainApplication.java:28: error: constructor ReactNativeAudioStreamingPackage in class ReactNativeAudioStreamingPackage cannot be applied to given types;
            new ReactNativeAudioStreamingPackage()
            ^
  required: Class<?>
  found: no arguments
  reason: actual and formal argument lists differ in length
1 error
:app:compileDebugJavaWithJavac FAILED

How my MainApplication.java looks like:

package com.anansimobile;

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

import com.facebook.react.ReactApplication;
import com.audioStreaming.ReactNativeAudioStreamingPackage;
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(),
            new ReactNativeAudioStreamingPackage()
      );
    }
  };

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

sbalay commented Oct 14, 2016

Same problem here

@sbalay
Copy link

sbalay commented Oct 14, 2016

@sergiovilar this get's easily fixed by adding MainActivity.class as a param of ReactNativeAudioStreamingPackage. That is:

new ReactNativeAudioStreamingPackage(MainActivity.class)

@tlenclos
Copy link
Owner

Fixed with #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants