主应用程序.java
我对安卓系统比较陌生,我正在尝试创建一个在线音乐播放器应用程序。我使用了objectbox数据库的对象,我得到了以下错误。我不知道如何修复它。下面是我的代码
package lrandomdev.com.online.mp3player;
import android.app.Application;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
import com.google.firebase.FirebaseApp;
import com.google.gson.JsonObject;
import com.onesignal.OSNotification;
import com.onesignal.OSNotificationOpenResult;
import com.onesignal.OneSignal;
import org.json.JSONObject;
import io.objectbox.BoxStore;
import io.objectbox.annotation.Entity;
import lrandomdev.com.online.mp3player.helpers.ApiServices;
import lrandomdev.com.online.mp3player.helpers.RestClient;
import lrandomdev.com.online.mp3player.models.MyObjectBox;
import retrofit2.Callback;
import retrofit2.Response;
public class MainApplication extends Application {
private BoxStore mBoxStore;
private static MainApplication sApp;
private static GoogleAnalytics sAnalytics;
private static Tracker sTracker;
@Override
public void onCreate() {
super.onCreate();
sApp = MainApplication.this;
FirebaseApp.initializeApp(getApplicationContext());
OneSignal.startInit(this)
.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
.setNotificationOpenedHandler(new NotificationOpenHandler())
.unsubscribeWhenNotificationsAreDisabled(true)
.init();
sAnalytics = GoogleAnalytics.getInstance(this);
mBoxStore = MyObjectBox.builder().androidContext(MainApplication.this).build();
ApiServices apiService = RestClient.getApiService();
final retrofit2.Call<JsonObject> call = apiService.getAds();
call.enqueue(new Callback<JsonObject>()
错误
android_app\app\src\main\java\lrandomdev\com\online\mp3player\MainApplication.java:29: error: cannot find symbol
import lrandomdev.com.online.mp3player.models.MyObjectBox;
^
symbol: class MyObjectBox
location: package lrandomdev.com.online.mp3player.model
暂无答案!
目前还没有任何答案,快来回答吧!