objectbox-java icon indicating copy to clipboard operation
objectbox-java copied to clipboard

cannot resolve symbol MyObjectBox

Open prashsb opened this issue 9 years ago • 15 comments

Issue Basics

  • ObjectBox version 1.1.0
  • Reproducibility: [ always]

Reproducing the bug

Description

In application while initializing the boxstore getting this issue

Code

my root level gradle buildscript { ext { _buildToolsVersion = '26.0.1' _compileSdkVersion = 26 objectboxVersion = '1.1.0' } repositories { jcenter() mavenCentral() maven { url "http://objectbox.net/beta-repo/" } } dependencies { classpath 'com.android.tools.build:gradle:2.2.3' classpath 'com.google.gms:google-services:3.1.0' classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"

}

}

allprojects { repositories { jcenter() mavenCentral() maven { url 'https://maven.fabric.io/public' } maven { url "http://objectbox.net/beta-repo/" }

}

}

task clean(type: Delete) { delete rootProject.buildDir }

prashsb avatar Oct 03 '17 19:10 prashsb

Did you check http://objectbox.io/faq/ --> Troubleshooting?

greenrobot avatar Oct 03 '17 21:10 greenrobot

As I am new to android, I am unable to find out android-apt. Can you guide me, how to remove it?

prashsb avatar Oct 04 '17 07:10 prashsb

@prashsb You probably did that, but just in case.

  • Create any @Entity class, just for the ObjectBox to work with something
  • Click the build button

Now MyObjectBox should be there.

If you did that and I am stating the obvious, my apologies

alex199568 avatar Oct 05 '17 20:10 alex199568

Same problem here. I have just wasted 2 days on this. cannot resolve symbol myObjectBox. I cannot reference DaoSession as well.

josephcaxton avatar Oct 06 '17 12:10 josephcaxton

@prashsb Did you resolve the issue using @alex199568's info?

greenrobot avatar Oct 07 '17 12:10 greenrobot

@josephcaxton Did you resolve your issue meanwhile? If not, please post your Gradle files.

greenrobot avatar Oct 07 '17 12:10 greenrobot

No

Joseph

On 7 Oct 2017, at 13:19, Markus Junginger [email protected] wrote:

@prashsb Did you resolve the issue using @alex199568's info?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

josephcaxton avatar Oct 07 '17 12:10 josephcaxton

@greenrobot my issue solved using @alex199568 info. Before creating box create entity class and build your project then create box.

prashsb avatar Oct 07 '17 17:10 prashsb

@josephcaxton We would need your Gradle files to give you assistance.

greenrobot avatar Oct 08 '17 09:10 greenrobot

No response, see #206 for MyObjectBox without entities.

greenrobot avatar Oct 22 '17 18:10 greenrobot

I am also getting this issue, Not able to create MyObjectBox class internally. Please help

tiwari-rajan avatar Nov 23 '17 06:11 tiwari-rajan

@tiwari-rajan You would have to explain what you are doing, etc. Also, please do not comment on this closed issue to avoid spamming the others. In your case it would be best if you post on stackoverflow.com. Thank you!

greenrobot avatar Nov 23 '17 11:11 greenrobot

First, create some Entity class and try to build the project after that you can able to call.the MyObjectBox class

sefonixy avatar Dec 21 '17 14:12 sefonixy

Done.. Thanks

tiwari-rajan avatar Dec 21 '17 15:12 tiwari-rajan

You just need to import it to the class: If you look keenly you realize, its not referenced.

import com.example.project.MyObjectBox;

nickmuteti avatar Aug 12 '20 08:08 nickmuteti