Error while building Unity3D Android Game := Plugins colliding with each other - android

when I build the game in Unity3D ,
it makes error :"plugins colliding with each other"
I am using Facebook SDK and Playfab.com SDK
Found plugins with same names and architectures,
Assets/Plugins/Android/libs/android-support-v4.jar (ARMv7) and
Assets/Plugins/Android/android-support-v4.jar (ARMv7). Assign
different architectures or delete the duplicate.
UnityEditor.AndroidPluginImporterExtension:CheckFileCollisions(String)
UnityEditorInternal.PluginsHelper:CheckFileCollisions(BuildTarget) (at
C:/buildslave/unity/build/Editor/Mono/Plugins/PluginsHelper.cs:25)
UnityEditor.HostView:OnGUI()
I tried to remove this file : Assets/Plugins/Android/libs/android-support-v4.jar
but I got another error
Error: [Temp\StagingArea\AndroidManifest-main.xml:3, D:\work\Apes
Shelter\Temp\StagingArea\android-libraries\facebook-android-sdk-4.7.0\AndroidManifest.xml:3]
Main manifest has but library
uses minSdkVersion='15'
any help will be appreciated :)

Check Minimum API Level in 'Build Settings/Other Settings'.
Here is someone with the same problem. Just set Minimum API Level to 15.

PROBLEM WHEN BUILDING ANDROID AND FACEBOOK SDK
this happens because 2 things:
1.Facebook SDK include files already contained in Assest/plugins/android, and
AndroidManifest.xml has to be updated.
so I did this:
Open AndroidManifest.xml (Assest/plugins/android/AndroidManifest.xml) with Xcode or Text edit and change line to this:
uses-sdk android:minSdkVersion="15" android:targetSdkVersion="23"
READ the error, it will tell you the values needed.
Assest/plugins/android/libs (NOT FacebookSDK/plugins/android/libs ) select All files, and in inspector deselect "android". (some people suggest to delete them, but i just deselect them so when the project builds they won't be included).
in finder look for .jar files duplicates and delete the ones that are in plugins/android Not the ones in Facebook
this was my case, maybe your is different, what I did was to look for duplicate files in Facebook SDK and Assest/plugins/android!

Related

Google Play Services : target=android-19 in project.properties

I am utilizing the library BaseGameUtils and google-play-services_lib. In the project.properties file I could see the below mentioned line .
target=android-19.
What is the significance of this? Can I change this to "target=android-21". This is just to be in sync with the App's manifest file
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
Yes. You can change this, Depending target only, packages load for you in eclipse.
What is the significance of target=android-19?
target = android-X in project properties file means that Eclipse will not allow use methods or classes from SDK higher than X. It will show compiler errors.
How to change target:
Right click your project.
Then click "Properties".
Then select "Android" from the tree on the left.
You can then select the target version on the right.
NOTE: Before doing this make sure your project.properties and classpath are not in read-only mode otherwise it won't work. Also don't try to edit this file manually.
As a general rule I use the following guidelines
android:minSdkVersion="8"
Set this to the minimum level you want to support. Check which Android version that it actually relates to and make sure that you have compatibility with that version. For example, I think 8 = Android 2.2, which could be a problem if you are using google play services libraries. It is good practice to at least test that you app will work properly on this version using the emulator, because otherwise you will get a lot of errors and bad reviews.
android:targetSdkVersion="21" />
I usually set this to the maximum version that I have actually tested my app on. I thin 21 is Android 4.4, so you should be making sure that your app works correctly on this version of Android. At the least, you should test that it will run in an emulator that is configured with this version of Android.
Hope this helps.

How to install a custom datepicker in Android

I have download this custom datepicker:
https://github.com/flavienlaurent/datetimepicker
I'm new to Eclipse and Android.
How should I use this?
When I import, I get an error at res folder.
http://i.stack.imgur.com/Dh7df.jpg
Please help me.
Sorry for asking a noob question.
Thanks
I've imported the datepicker to my Eclipse and I can to build it without any error.
Have you downloaded all the necessary Android SDK files using the Android SDK Manager? I see your 'MainActivity' is having compile error too.
Edit:
From the errors, seems like the attributes buttonBarStyle were only defined starting in API Level 11.
There are a few ways to solve this.
1) Set your app and the library project minSdkVersion in AndroidManifest.xml file to "11", this will make your app not be able to use on older Android versions though.
2) Move this particular layout file to res/layout-v11/ folder, and create another version of the same layout file in res/layout folder, but doesn't use the buttonBarStyle.
3) Seems like there's a way to create a attr.xml file in res/layout, and define the attributes manually. I have not tried it personally though you might want to try.. refer to error: Error: No resource found that matches the given name: attr 'buttonBarButtonStyle'
Good luck
Edit2:
Changing android:minSdkVersion="11" and android:targetSdkVersion="17" in your datetimepicker AndroidManifest.xml file should work!
From your screenshot, I saw that it doesn't recognize "HONEYCOMB", seems like your ADT version is not the latest, please try update it to the latest first.
After that right click your datetimepicker-library project in Eclipse, click 'Properties', then go to 'Android' tab, you should see API 15 or above checked, for mine I have API 17 checked as shown here http://i.imgur.com/Z3DkRY1.png
I think your eclipse is not configured properly
Just ran in the same problem. In order to use this library make sure that:
Datetimepicker-library references NineOld Androids
Project properties, Java build path, Libraries contains android-support-v4 and order and export has this jar checked
Project properties, Android, project target build is set to API 19 for example
The last one was causing most of the problems. If you set it to a higher target build, that does not mean that it will not run on lower API levels.

Importing project gave Unable to resolve target 'android-7'

This app I completed around a year ago (!) but never launched it on the market place. I am trying to open it up in eclipse now to make some small modifications and work on the code a little bit. So I imported it and then found this weird "unable to resolve target" error. It's highlighting every class red in all my 'src' files.
I've looked at a similar question which said to add the line to default.properties file. My project has a project.properties file which has the line:
target=android-7
Any advice how to get this to work? I could always start a new project and just copy all the src files but that would be pretty lame and time-wasting.
One more comment - I'm developing on a new computer and I don't think I have the API level 7. Could that be the problem? I've gone into Window --> Android SDK Manager and the oldest available API it shows is level 8. But level 7 will mean I can target more devices I think so I'd like to go with that.
Thank you for any help.
Well, yes that is your problem. You don't have the API level 7 downloaded. You can right click the project and go properties->android and select another available API. As long as you don't change the min sdk version in your manifest you are still targeting as many devices as before.
<uses-sdk android:minSdkVersion="7"/>
Update
You don't have to do this, but you can get the older APIs on the SDK Archives page
I don't know if there is any official source for the next statement but that is what I found while working. If anybody can complete this with a better answer I would appreciate it very much.
You can compile the code with a newer SDK version as long as you don't use any code not compatible to the previous ones.
Example:
I want my app to be available for API level 7. But i only have API level 15 installed. As long as I keep the minSdkVersion="7" in my Manifest and don't use any resource not available in the previous APIs the app will work just fine on my targeted devices.
For anyone who wants to test their project against an API level that isn't the most recent one, you can just use the SDK Manager to install the old SDK:
In Eclipse (with adt installed):
SDK Manager:
Just check the box of the SDK you want to use to test against your project and click install. You can also remove API's that you aren't using.
Right click on your project then:
Properties -> Android -> Project build target -> Check Android 4.1.2
In your application's manifest.xml file add this tag
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />
It's worked for me. Try it.
I resolved this issue by editing my project.properties file
from: target=android-7
to: target=android-19.
I also changed the target sdk version in the manifest file:
android:targetSdkVersion="19".
Yes. I see the same problem when I import the android support v7 project as a library project in my own project,the eclipse says that cannot resolve android16, I find that it's the problem of the eclipse,you can right-click your project which has this problem,and then select properties,the Android pane,there is a Project Build Target pane there,you can see it easily,choose a standard android platform,like Android4.3,not others that start with Google API,I hope that this will help you!
check android:minSdkVersion= in the AndroidManifest.xml
update target=android- in the project.properties if you use Eclipse IDE

Third party library troubles on LayerType attribute even after building it on Android 3.2

So, I coded my entire app in Android 4.0.3. I used AmbilWarna color picker. Then I got this requirement to reduce the SDK requirement for Android 2.3. This is the point when EVERYTHING was working fine and superb
I have downgraded teh minimum SDK requirement. Everything runs fine except as soon as I include Ambil Warna as a library on my project, I start getting the error everywhere R is used, Saying that R cannot be resolved to a variable.
Upon a loot on the Console, this is what seems to be the real cause of the problem:
AmbilWarna\res\layout\ambilwarna_dialog.xml:18: error: No resource identifier found for attribute 'layerType' in package 'android'
I have set the Android SDK to 3.2 for AmbilWarna library project and on my project its at 2.3
Does anyone have any idea?
this is regarding this: http://developer.android.com/reference/android/view/View.html#attr_android:layerType
you are just trying to use a property for android that is not available on that api of the layout parser.
I just checked out the colorpicker code you are trying to use, and it's project.properties says it's written for target API-17 (android 4.2) and i'm tryng to compile it for API-10 (android 2.3.3)
simply remove those parts.
my diff
--- a/AmbilWarna/res/layout/ambilwarna_dialog.xml
+++ b/AmbilWarna/res/layout/ambilwarna_dialog.xml
## -19,7 +19,7 ##
android:id="#+id/ambilwarna_viewSatBri"
android:layout_width="#dimen/ambilwarna_hsvWidth"
android:layout_height="#dimen/ambilwarna_hsvHeight"
- android:layerType="software" />
+ />
and hope it's not mentioned in the code :)
I've had a lot of troubles too with my external libraries. What usually helped are one of these or multiple steps of these connected:
Delete ALL R.java imports in your Classes (there must not be any of them)
In Eclipse: Source => "Clean Up"
In Eclipse: Project => "Clean..." (This will rebuild your project from scratch and therefore regenerate your R.java)
Manually delete all R.java and save (located in /gen/)
Delete your external library project and readd it.
Step 3 usually did the job for me.
Also be aware that your minSdkVersion and targetSdkVersion fit to your library project (and the guidelines which are included)
I had the same problem, I thought I could just build and include the third party jar file and bring this over to my project - this resulted in the same problem as you - AmbilWarna\res\layout\ambilwarna_dialog.xml error: No resource identifier found for attribute 'layerType'.
To fix it I copied over the source files and all resources into my project (images/layouts etc etc), hey presto it worked.
Thanks http://code.google.com/p/android-color-picker/ for a nice clean easy to use colour picker!!

styles.xml error in eclipse library project for google downloader when app is preApi9

I am playing with the new google expansion pack stuff, and the google library project for the downloader has a special values-v9/styles.xml file for the notification text properties. This causes an error when the app that is using the library is preAPI9... at least for me. It is referring to some style stuff that only appeared in api9. I've tried setting
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="9" />
in the AndroidManifest.xml of the main app, but this didn't help. I would (naively) hope eclipse would just ignore the error if I'm building for api8, and then when deployed on the market the system would use the values-9 stuff if the phone were at or above that level, but it doesn't seem to work that way. So, I'm hoping I'm missing something trivial here.
btw - here are the specific errors
Description Resource Path Location Type
error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.StatusBar.EventContent.Title'. styles.xml /Google Play Downloader Library/res/values-v9 line 4 Android AAPT Problem
Description Resource Path Location Type
error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.StatusBar.EventContent.Title'. styles.xml /Google Play Downloader Library/res/values-v9 line 4 Android AAPT Problem
Yes, I'm getting this also. I posted a related question here:
Android apk expansion file libs problems
I'm stumped to know what to do.
Update:
This worked for me. I deleted the values-v9 folder and rebuilt everything. The DownloadManager is now working. How, I don't know.
Try changing build target via Project->Properties->Android AND/OR Clean your project via Project->clean...
This worked for me after having to manually create the styles.xml file inside the styles-v9 folder through windows explorer.
I've fixed this error by building the project with the following commands:
android update project -p . -t 3 --target android-10
ant release
The first command tells to use the Android 2.3.3 toolchain for buiding the project.
Note that I still have android:minSdkVersion="8" in AndroidManifest.xml.
You should not delete the values-v9/ folder. Removing it can cause displaying notification with dark font on dark background.
If you download the latest api version, you should be able to build the library project against that correctly.
At runtime, Android will discard any code that doesn't work with the api on the device (you'll see various log messages about this), and ignore any res folders with a too high version number. Watch out for the v11 notification code, however: it only works on v14 and above so you'll have to change the code which decides which notification to use.

Categories

Resources