Closed thomas-alrek closed 7 years ago
You need to change/modify imports.
Example:
import com.estimote.coresdk.common.config.EstimoteSDK;
import com.estimote.coresdk.observation.region.Region;
import com.estimote.coresdk.observation.region.RegionUtils;
import com.estimote.coresdk.observation.region.beacon.BeaconRegion;
import com.estimote.coresdk.observation.utils.Proximity;
import com.estimote.coresdk.recognition.packets.Beacon;
import com.estimote.coresdk.service.BeaconManager;
Thanks for the tips! I must have been following an old guide.
However, I am still not able to build.
BUILD FAILED
Total time: 12.327 secs
Error: /Users/thomasalrek/dev/test/platforms/android/gradlew: Command failed with exit code 1 Error output:
/Users/thomasalrek/Dev/test/platforms/android/src/no/apility/cordova/EstimoteWrapper.java:7: error: package com.estimote.coresdk.common does not exist
import com.estimote.coresdk.common.requirements;
^
/Users/thomasalrek/Dev/test/platforms/android/src/no/apility/cordova/EstimoteWrapper.java:31: error: cannot find symbol
if (SystemRequirementsChecker.checkWithDefaultDialogs(this)) {
^
symbol: variable SystemRequirementsChecker
location: class EstimoteWrapper
2 errors
FAILURE: Build failed with an exception.
I double checked the class namespace, and it should be correct now, according to the documentation.
I can't really spot any thing obvious that could cause this.
package no.apility.cordova;
import org.json.JSONArray;
import org.apache.cordova.*;
import org.json.JSONException;
import com.estimote.coresdk.common.requirements;
public class EstimoteWrapper extends CordovaPlugin
{
private static final String tag = "EstimoteWrapper";
/**
* Plugin initializer.
*/
@Override
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
super.initialize(cordova, webView);
Log.i(tag, "initialize");
}
public boolean requestAlwaysAuthorization(final CallbackContext callbackContext) {
Log.i(tag, "requestAlwaysAuthorization");
if (SystemRequirementsChecker.checkWithDefaultDialogs(this)) {
callbackContext.success(1);
return true;
}
callbackContext.error(0);
return false;
}
public boolean requestWhenInUseAuthorization(final CallbackContext callbackContext) {
Log.i(tag, "requestWhenInUseAuthorization");
if (requestAlwaysAuthorization(callbackContext)) {
callbackContext.success(1);
return true;
}
callbackContext.error(0);
return false;
}
/**
* Plugin reset.
* Called when the WebView does a top-level navigation or refreshes.
*/
@Override
public void onReset() {
super.onReset();
Log.i(tag, "onReset");
}
/**
* The final call you receive before your activity is destroyed.
*/
@Override
public void onDestroy() {
super.onDestroy();
Log.i(tag, "onDestroy");
}
/**
* Entry point for JavaScript calls.
*/
@Override
public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
Log.i(tag, "execute " + action);
if (action == null) {
return false;
}
if ("requestAlwaysAuthorization".equals(action)) {
return requestAlwaysAuthorization(callbackContext);
}
if ("requestWhenInUseAuthorization".equals(action)) {
return requestWhenInUseAuthorization(callbackContext);
}
return false;
}
}
Hi @thomas-alrek,
are you sure you're importing well? I would write this:
import com.estimote.coresdk.common.requirements.SystemRequirementsChecker;
to import the SystemRequirementsChecker
class.
Yeah @xcastoreo that worked! Thanks
Hello.
I am trying to build a Cordova based project, and am unable to compile.
I have added
In a custom gradle file. And I have verified that the dependency has been downloaded
This is what happens when I try to build the project:
Any idea what might be the problem?