Closed AtlasMaxima-zz closed 6 years ago
No, the only steps required are those displayed on Readme.
you can check if react-native link
has linked everything correctly, see this example:
android/build.gradle
add the jitpack repository to your project.allprojects {
repositories {
mavenLocal()
jcenter()
+ maven {
+ url "https://jitpack.io"
+ }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$projectDir/../../node_modules/react-native/android"
}
}
}
android/app/build.gradle
, add the easy-bluetooth-classic dependencydependencies {
+ compile project(':easy-bluetooth-classic')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
android/settings.gradle
include ':app'
+ include ':easy-bluetooth-classic'
+ project(':easy-bluetooth-classic').projectDir = new File(rootProject.projectDir, '../node_modules/easy-bluetooth-classic/android')
android/app/src/main/java/com/example/MainApplication.java
, add the ClassicPackage
dependency.import com.facebook.react.ReactActivity;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
+ import io.github.douglasjunior.ReactNativeEasyBluetooth.classic.ClassicPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
...
/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
+ new ClassicPackage()
);
}
}
thank you for the help
The app build failed because
import io.github.douglasjunior.ReactNativeEasyBluetooth.classic does not exist
which failed to retrievenew MainReactPackage(), new ClassicPackage()
I followed the steps under installation. Would I need to put the ClassicPackage inside of my project folder somewhere?