- Home /
Package com.unity3d.player does not exist
I tried to make Android (google) project from Unity (to obfuscate some dlls and then make apk by hands).
My project uses facebook sdk. The problem is to make project without this error in facebook source files: "package com.unity3d.player does not exist".
It happens on:
import com.unity3d.player.UnityPlayer;
I can't figure out how to solve this issue. What do I do wrong? any facebook settings wrong? missing some libraries? what is going on?
Answer by rumaniel · Jun 19, 2015 at 06:32 AM
Have u check Java Build Path in Eclipse Properties?
In Unity3d Editor, Plugin/Android folder doesn't contain 'classes.jar'(maybe?) but Expoerted project should added 'classes.jar'.
So you need Add jar path in Eclipse or Android Studio project settings.
It also contains bolts.jar or android-support-v4.jar in java build path.
unity classes.jar path are in
(Win path) C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer\bin\classes.jar
(Mac path) Unity.app(show packages)\Contents\PlaybackEngine\AndroidPlayer\bin\classes.jar
classes.jar contains in "facebook\bin" folder
bolts-android-1.1.2.jar and android-support-v4.jar contains in project module in "[project name]\libs" folder (but facebook module doesn't get it, so it can't resolve referencies) Do I have to copy that files into facebook module?
may be something wrong with my manifest??? I use Android Studio, but can try to export project to Eclipse.
I checked project's JD$$anonymous$$ paths is O$$anonymous$$
I added bolts-android-1.1.2.jar and android-support-v4.jar for facebook module from [my project] module, added file dependencies => then 82 errors about missing references disappeared. THX a lot for your hint!
Now I have the only 19 errors: package com.unity3d.player doesn't exist and cannot find symbol variable UnityPlayer
$$anonymous$$aybe manifest is ok.
Bin folder contains complied files. So that is maybe not Unity3d clasess files.
So you should copy unity claesses.jar file to your project.
I don't know how Android Studio works. but you can make a dependency both project with jar file.
Java Build Path means where locate jar file path ;) not JD$$anonymous$$. It's na$$anonymous$$g of eclipse's feature.
THX!!! I made a copy of unity classes file and it solved my problem!
Answer by Yury-Habets · Jun 18, 2015 at 08:07 PM
You seem to be missing Unity's classes.jar file (should be present if you export the project from the Editor).
nope, classes.jar exists in project. I think the problem can be solved by adding some dependency. There were missing 2 dependencies (com.parse.bolts and com.android.support) in facebook module after Unity compilation, so, I think facebook module lack of one more :(
Check Assets/Plugin/Android/facebookSD$$anonymous$$(or something facebook sdk project path)/libs/
It should contains bolts.jar and android support jar.
It should contains bolts.jar and android support jar.
Project contains them, but in built Android projects I can't find them, so I added dependencies com.parse.bolts and com.android.support. There is one unsolved problem with import com.unity3d.player -> missing UnityPlayer reference
Exported Android project should have claasess.jar in ProjectPath/
If you are using Eclipse, Check Eclipse -> Project Properties -> Jave Build Path -> Libraries. If there are no path in classes.jar, then you should add classes.jar file.
It makes dependency jar file on your project.
You can find classes.jar in
(win32) C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer\bin\classes.jar
(mac) Unity.app (Show Packages)\Contents\PlaybackEngine\AndroidPlayer\bin\classes.jar
Your answer
Follow this Question
Related Questions
CommandInvokationFailure: Failed to re-package resources. 0 Answers
Building an IOS app with Facebook SDK integration 2 Answers
How come when I generate a signed APK it produces out a JKS file? 0 Answers
How to setup android keystore in unity cloud build? 0 Answers
Unity Android Build Error,Build Faild with unity editor 0 Answers