I followed
http://developer.android.com/google/play-services/setup.html
to setup a library project (in eclipse) and then added this library project as a dependency in my Android project. (properties->Android->Add)
It caused the build to not create R.java without any specific error and caused thousands of compilation errors (references to class R).
I figured that if I change the order of library dependencies, this problem goes away. (Google Play Services library must be the first dependency in my project). Not sure why.
I am posting this (a) for others and (b) to know why.
Related
I am using facebook-unity-sdk-7.3.0 and GooglePlayGamesPlugin-0.9.32 in my project. it does not let me build for android and fails with error 'Unable to convert classes into dex format. See the Console for details.'. It starts working again when I delete any of the sdk fb or googleplay from my project.
Console error
CommandInvokationFailure: Unable to convert classes into dex format.
See the Console for details.
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java
-Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/shoaib/Library/Android/sdk/tools"
-Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar"
and
Error building Player: CommandInvokationFailure: Unable to convert
classes into dex format. See the Console for details.
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java
-Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/shoaib/Library/Android/sdk/tools"
-Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar"
I did some research on it and found that this issue is related to two same jar files in the project but in my project, I unable find any duplicate jar file.
Edited
for reproducing the issue, I have made a sample project which can be downloaded from here http://wikisend.com/download/966354/LeaderboardTest.zip
Go to Assets->FacebookSDK->Plugins->Android->libs then delete android-support-v4.jar. There is a conflict there because it contains a class from another jar or aar file.
'Unable to convert classes into dex format. See the Console for details.'.
this one shows up when a class/dll exists twice in the project.
Often it happens when updating framework, if you do not remove the old version properly, then some classes may appear twice.
Since they are stored in plugins folder, Unity does not check them and they only show up in build process.
Best could be to remove everything related to both plugins and reimport them. That solved it for me when using UniWebView and Vuforia in same app. One of those was not properly updated.
In my case I could solve this problem by removing Android SDK Build-Tools version 24 and replacing it with version 23.
Maybe it's too late to answer, I was facing the same issue, I created a plugin this plugin contains Facebook SDK+Admob+unityads +unity IAP, all of them work together, I've created this plugin in unity 5.6.0, but I've checked it, it is working fine in unity 2017 as well, there is a scene "DemoScene", just open it everything is implemented, unity ads, admob, facebook share with callback, unityIAP.
Note: before importing the plugin kindly delete all the old plugins, also go to services and turn on unity ads.
http://www.mediafire.com/file/ccvj7ixir8ive25/FB_ADMOB_UnityIAP_UnityAds_Plugin_Hameed_Ullah_jan.unitypackage
I'm trying to create an Android application in Android Studio. When I try to create the project, it tells me that the Gradle refresh failed, with the error message
Error:Cannot find JAR 'ivy-2.2.0.jar' required by module 'gradle-dependency-management' using classpath or distribution directory 'C:\Gradle\gradle-2.10'
What is ivy-2.2.0.jar, and how do I fix this?
As of 7/19/2017, I have seen that the ivy-2.2.0.jar file is included in both the binaries-only and the complete installations for Gradle.
The file is located here:
gradle-4.0.1\lib\plugins\ivy-2.2.0.jar
Ironically, I received the same issue when attempting to build one of Oculus's VR sample projects.
When switching to the complete installation, I no longer received this specific error.
Perhaps try switching to the complete installation, or migrating the project to use any Gradle Wrappers that might be available.
This might happen if you are using the complete distribution with sources of Gradle. Try out the binary only distribution. It should work.
I'm getting this error message repeated 3 times after implementing leaderboard/achievement coding:
07-18 10:27:02.351: E/GooglePlayServicesUtil(14261): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
this appears to be generated by the 'GameHelper.java' file in the imported 'BaseGameUtils' library project referenced as a library by my game app.
I have google-play-sevices_llb imported to my workspace, and its referenced as a library in the BaseGameUtils library itself. there is a google-play-services.jar in the Android Private Library of BaseGameUtils. there is a google-play-services_lib.jar in the Android Dependencies folder. there is a android-support-v13.jar in the base folder of BaseGameUtils (updated from v4). I believe everything is set up correctly on the developer and game.developer pages and I have the 2 required lines added in the manifest of my game app.
I see pages on this for google mapping and admob where the answers basically suggest ignoring it if everything appears to be working. however, I don't see pages on this error for leaderboards/achievement implementation and it does appear to be preventing the service connection here.
I'm unable to access services for leaderboards/achievements. I'm still getting abmod banners so my game app does appear to access services code, the services jar is also in my game app's private library.
Please import google_play_services project in /sdk/extras/google/google_play_services/libproject because you need resources -res's folder in this project.
You add google-play-services.jar in libs not enough.
Hope this help!!!!
I am trying to use Google Play Games Services with my android project. I have followed instructions as both seen on the official documentation and here as well: http://helios.hud.ac.uk/u1070589/blog/?p=202
Both libraries BaseGameUtils and google-play-services_lib are added and referenced by my project. BaseGameUtils references google-play-services_lib.
All boxes are checked under Properties -> Java Build Path -> Order and Export.
I receive the following error when attempting to run:
Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
I don't understand the issue. I have followed the instructions exactly. And retried several times.
Any ideas?
I had to go into the Java Build Path and remove BaseGameUtils and google-play-services_lib from there.
Also to remove another error I had to go into the libraries section and add the two jars (basegameutils.jar and google-play-services.jar.)
I'm not sure why this last part was nowhere in the instructions but this fixed the problem.
I have been working with Java for about a couple of months now and I have been stuck introducing Google API into my Maps app. I need some help with these imports.
Here is what I did: I was following the code of a Places API demo which I can link if needed. I ended up having to add some libraries. Before I did, I was getting errors from all of the imports that started with com.google.api.client...etc. Then once I added all of these libraries, I then got left with 2 errors out of my imports.
The errors are: the "com.google.api.client.googleapis.GoogleHeaders" and "com.google.api.client.http.json.JsonHttpParser". I am receiving them both as "cannot be resolved to a type". These errors are causing some more errors throughout the rest of my code. I was hoping someone can help me solve this. I know it should have something to do with my code, but I am not sure what is going on. I know I am missing something.
Also, I installed the Google Plugin to install the APIs and when I did, I added the "Google + API" and the "GoogleOAuth2" APIs and that is where I am stuck at. Please someone help.
Here is the screenshot: Full Screenshot
I haven't worked with Maps, but as I understand it Maps is now packaged with Google Play Services, which I have been working with recently.
Firstly, the installation of Google Play Services is well-documented and you should look at this (if you haven't done so already):
http://developer.android.com/google/play-services/setup.html
There are a few areas that cause difficulty, and one is the section "Set Up a Project with the Library". There are different possible approaches but I suggest you take the following steps.
Ensure that the Google Play Services lib (and any other libs) are defined as library projects (Properties ...Android.. Library ...IsLibrary) and that they have no errors (cleaning may not be sufficient - you may have to shut down Eclipse to remove the errors).
When the library projects are error free, add them to your project. The normal way of doing this is to REFERENCE them (check what the documentation says) but you do this by (Properties ...Android.. Library ...Add).
Then check out (Properties ... Java Build Path ...) - read the documentation but you need your libs in here.
Then clean your project but note that a restart of Eclipse may be necessary to remove the errors from your project.
There are other errors that can arise - another common one arises if you have different versions of the v4 support lib in your libs / project and you get a message "...this check is based on SHA1 at this time". This is well documented on Stack Overflow.
Good luck !