-1

Background: I'm trying to make a simple with RxPermissions .. I created a new project with the bellow code/setup but when I launch the app I got a dialog with the message "unfortunately package installer has stopped"

gradle.build

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  testCompile 'junit:junit:4.12'
  compile 'com.android.support:appcompat-v7:24.1.1'
  compile 'com.tbruyelle.rxpermissions:rxpermissions:0.7.0@aar'


  compile 'io.reactivex:rxandroid:1.2.1'
  // Because RxAndroid releases are few and far between, it is recommended you also
  // explicitly depend on RxJava's latest version for bug fixes and new features.
  compile 'io.reactivex:rxjava:1.1.6'

}

MainActivity.java

public class MainActivity extends Activity {

  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Must be done during an initialization phase like onCreate
    ((Button) findViewById(R.id.button)).setOnClickListener(new View.OnClickListener() {
      @Override public void onClick(View view) {
        RxPermissions.getInstance(MainActivity.this)
            .request(Manifest.permission.CAMERA)
            .subscribe(new Action1<Boolean>() {
              @Override public void call(Boolean aBoolean) {

              }
            });
      }
    });


  }
}
TooCool
  • 10,598
  • 15
  • 60
  • 85

1 Answers1

1

I forgot to declare the permission Manifest.permission.CAMERA in the manifest.

TooCool
  • 10,598
  • 15
  • 60
  • 85