aboozaid / react-native-wifi-hotspot

A react-native implementation for handling hotspot requests and make it easier to communicate with peers!
ISC License
40 stars 21 forks source link

cannot find symbol #10

Closed luandro closed 4 years ago

luandro commented 4 years ago

Seems related to #6, but the suggested fixes don't seem to work with latest react-native 0.61.2.

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/home/app/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:78: error: cannot find symbol
      new HotspotModule()
          ^
  symbol:   class HotspotModule
  location: class PackageList
1 error

Tried adding package manually to MainApplication.java without success:

@Override
    protected List<ReactPackage> getPackages() {
      @SuppressWarnings("UnnecessaryLocalVariable")
      List<ReactPackage> packages = new PackageList(this).getPackages();
      // Packages that cannot be autolinked yet can be added manually here, for example:
      packages.add(new HotspotPackage());
      return packages;
    }

Any suggestions?

aboozaid commented 4 years ago

did you import the package name at the top of MainApplication.java before adding it to packages?!

luandro commented 4 years ago

Yup @assemmohamedali!

aboozaid commented 4 years ago

I don't think you add it correctly, could you please re-try? read this as well https://github.com/react-native-community/cli/blob/master/docs/autolinking.md

luandro commented 4 years ago

Got it to work! :tada:

Disabled autolinking as documented here.

Details on manually adding it can be found here.

Patrick-Erichsen commented 4 years ago

This worked for me as well running react-native 0.61.5, thanks!