(Unity3d) Chartboost and Admob can't Compatible - unity3d

In my game, there is already a Admob plugin setup, and I want to set up Chartboost plugin too. When I setup the Chartboost plugin, I can't make the apk package.
CommandInvokationFailure: Failed to re-package resources.
D:\Android\sdk\build-tools\25.0.1\aapt.exe package --auto-add-overlay
-v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "D:/Android/sdk\platforms\android-25\android.jar" -F bin/resources.ap_
--extra-packages android.support.v7.appcompat:com.unity3d.player:com.unity.purchasing:com.android.vending.billing:com.google.unity.ads:com.unity.purchasing.googleplay:com.google.example.games.mainlibproj:com.google.android.gms.ads.impl:com.google.android.gms.ads:com.google.android.gms.auth.api:com.google.android.gms.auth:com.google.android.gms.base:com.google.android.gms:com.google.android.gms:com.google.android.gms.clearcut:com.google.android.gms.drive:com.google.android.gms.games:com.google.android.gms.gass:com.google.android.gms.nearby:com.google.android.gms.tasks:android.support.v4:com.unity3d.ads:com.pushok.test
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\common\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\GoogleAIDL\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\GooglePlay\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-ads-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-ads-lite-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-auth-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-auth-base-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-base-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-basement-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-basement-9.0.0\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-clearcut-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-drive-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-games-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-gass-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-nearby-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\play-services-tasks-10.0.1\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\support-v4-24.0.0\res"
-S "E:\unityWork\MySlots\SlotsGame\Temp\StagingArea\android-libraries\UnityAds\res"
And seems to be the file AndroidManifest.xml made this error.

I have made a backup, so I use git to find what changed in my project.
I find when I set up the Chartboost (click 'Setup Android SDK' button), there is added a file play-services-basement-9.0.0.aar, And I already have play-services-basement-10.0.0.aar.So I delete the 9.0.0 file.
Now I can make the apk package!

Your error CommandInvokationFailure: Failed to re-package resources. might occurs when you have an AndroidManifest.xml file (Probably under Plugins/Android or a plugin in a subfolder of this folder) that tries to access a resource by name (google_play_services_version), but this value is never defined anywhere. Usually, this value is added via some method such as adding it to the AndroidManifest.xml or to an xml under res/values.
Another workaround is:
To fix this error, you have to copy the version.xml file from
android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/res/values/
into Assets/Plugins/Android/res/values/ of your Unity project's folder.
Additional resource:
Unity 5 Android Build - Failed to re-package resources
Failed to re-package resources : aapt.exe package

Related

Unity failed to re-package resources (using onesignal)

I updated my Onesignal Unity Apk files using the latest unitypackage available and i have not been able to compile for android since then. I've tried using different Android SDK Tools and unity versions.
I'm honestly out of ideas, any help will be appreciated. I'm using Uniwebview and Onesignal (just for the push notifications) plugins and unity 5.6.0f3 (it's not a problem to change versions if i need to).
C:\Android\android-sdk\build-tools\build-tools-23.0.1\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I
"C:/Android/android-sdk\platforms\android-26\android.jar" -F bin/resources.ap_ --extra-packages"C:\Users\JuanPC\Documents\tcervantes_unity\Temp\StagingArea\android-libraries\android.arch.lifecycle.livedata-core-1.1.0\res" -S "C:\Users\JuanPC\Documents\tcervantes_unity\Temp\StagingArea\android-libraries\android.arch.lifecycle.runtime-1.1.0\res" -S "C:\Users\JuanPC\Documents\tcervantes_unity\Temp\StagingArea\android-libraries\android.arch.lifecycle.viewmodel-1.1.0\res" -S "C:\Users\JuanPC\Documents\tcervantes_unity\Temp\StagingArea\android-libraries\com.android.support.animated-vector-drawable-28.0.0-alpha1\res" -S
I've made a pastebin with the complete error.
Full error here

Installing Realm via CocoaPods in Swift

I keep getting return code 56 from cURL, which is caused by SSLRead returning errors -36 or -9806 in terminal "pod install":
Example 1:
[!] /bin/bash -c
set -e
sh build.sh cocoapods-setup
core is not a symlink. Deleting...
Downloading dependency: core 0.97.0
Downloading core failed:
curl: (56) SSLRead() return error -36
Example 2:
[!] /bin/bash -c
set -e
sh build.sh cocoapods-setup
core is not a symlink. Deleting...
Downloading dependency: core 0.97.0
Downloading core failed:
curl: (56) SSLRead() return error -9806
Has anyone faced this problem installing Realm?
Check which version of xcode-select (Xcode command line tools) you are using. I have to switch between an older version and a newer version for building AOSP from source.
Check using:
gcc --version
The latest is Apple LLVM version 7.3.0 (clang-703.0.31).
You can also check in Xcode by navigating to Xcode > Preferences, selecting the Locations tab and make sure Command Line Tools matches the version of Xcode you are using (mine says Xcode 7.3.1).
You should download core via url first:
curl https://static.realm.io/downloads/core/realm-core-1.3.1.tar.bz2 -O
mkdir $TMPDIR/core_bin
mv realm-core-1.3.1.tar.bz2 $TMPDIR/core_bin
more detail in github:
Be sure that you can access https://static.realm.io/downloads/core/realm-core-0.97.0.tar.bz2 by browser. If not, then it is the problem of your network.
Someone asks for solutions. So following is how I solved this.
download https://static.realm.io/downloads/core/realm-core-0.97.0.tar.bz2 using browser(as for me, I am using shadowsocks, so I can download it).
mkdir $TMPDIR/core_bin
mv realm-core-0.97.0.tar.bz2 core-0.97.0.tar.bz2
mv realm-core-0.97.0.tar.bz2 $TMPDIR/core_bin
the third renaming operation depends on the real needed name used by realm. You should check out $TMPDIR/core_bin when realm starts to download.

Fixing win32Exeption in Unity for Mac

I've ported my Unity project from PC to Mac and now I can't compile muy builds, I get the following error:
Error building Player: Win32Exception: ApplicationName='/Users/josephtripp/Library/Android/sdk/tools/aapt', CommandLine='package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "/Users/josephtripp/Library/Android/sdk/platforms/android-22/android.jar" -F bin/resources.ap_ --extra-packages com.everyplay.Everyplay:com.unity3d.ads.android -S "/Users/josephtripp/sens-rebooted/Temp/StagingArea/android-libraries/everyplay/res" -S "/Users/josephtripp/sens-rebooted/Temp/StagingArea/android-libraries/unityads/res"', CurrentDirectory='Temp/StagingArea'
I've tried reimporting all assets but I can't seem to fix it, anyone have any idea?
I had this issue after updating android SDK
goto androidsdk\build-tools\19.1.0 (what ever is your version) and copy aapt.exe to androidsdk\tools\ and paste aapt.exe and now try building for android

rhomobile build for iphone fails, provisioning profile can't be found

I got a simple application I want to run on my iphone. However I get a annoying error the provisioning profile can not be found. It happens after I go to my project folder and run:
sudo rake device:iphone:production
=== BUILD NATIVE TARGET RhoLib OF PROJECT RhoLib WITH CONFIGURATION Release ===
Check dependencies
=== BUILD NATIVE TARGET rhoextlib OF PROJECT rhoextlib WITH CONFIGURATION Release ===
Check dependencies
=== BUILD NATIVE TARGET curl OF PROJECT curl WITH CONFIGURATION Release ===
Check dependencies
=== BUILD NATIVE TARGET rhorunner OF PROJECT rhorunner WITH CONFIGURATION Release ===
Check dependencies
Code Sign error: Provisioning profile '0558F1B2-FE5A-4236-B9EE-A200EFAD68E9' can't be found
cd ~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rhodes-3.3.3
set bundle identifier
set URL name
restore_default_images
rm -f platform/iphone/Default.png
rm -f platform/iphone/Default.png
cp platform/iphone/Default.bak platform/iphone/Default.png
rm -f platform/iphone/Default.bak
rm -f platform/iphone/Default#2x.png
rm -f platform/iphone/Default-Portrait.png
rm -f platform/iphone/Default-PortraitUpsideDown.png
rm -f platform/iphone/Default-Landscape.png
rm -f platform/iphone/Default-LadscapeLeft.png
rm -f platform/iphone/Default-LandscapeRight.png
restore icon
rm -f platform/iphone/icon.png
cp platform/iphone/icon.bak platform/iphone/icon.png
rm -f platform/iphone/icon.bak
rm -f platform/iphone/icon57.png
cp platform/iphone/icon57.bak platform/iphone/icon57.png
rm -f platform/iphone/icon57.bak
rm -f platform/iphone/icon72.png
cp platform/iphone/icon72.bak platform/iphone/icon72.png
rm -f platform/iphone/icon72.bak
rm -f platform/iphone/icon114.png
cp platform/iphone/icon114.bak platform/iphone/icon114.png
rm -f platform/iphone/icon114.bak
************************************
ERROR during building by XCode !
XCode return next error code = pid 9102 exit 65
I checked the xcode organizer and the profile is both on the phone and the library.
I checked developer.apple.com and the profile is Distribution Ad Hoc for the device plugged in.
My build.yml:
sdkversion: 3.3.2
name: My Application
version: 0.1
vendor: rhomobile
build: release
bbver: 4.6
applog: rholog.txt
iphone:
provisionprofile: 0558F1B2-FE5A-4236-B9EE-A200EFAD68E9
sdk: iphoneos5.1
codesignidentity: "iPhone Distribution"
entitlements:
configuration: Release
emulator: 5.1
emulatortarget: iphone
BundleIdentifier: com.randomname.myapplication
BundleURLScheme: myapplication
wp:
productid:
uid: 3928127822
android:
version: 2.1
extensions:
- accelerometer
Anyone got a clue what I missed here? Already been trying different things for a few days without result :(
After a while I found that the script checks for the provisioning profile in /Library/MobileDevice/Provisioning Profiles instead of ~/Library/MobileDevice/Provisioning Profiles. This is caused by using the sudo command, however without sudo I dont have permission. Workaround is to create a /Library/MobileDevice/Provisioning Profiles folder and copy the installed profile to that location. Code signing works fine now.
edit: even a better solution is to reinstall the rhodes gem without sudo. By installing the suite I had to sudo it to make system changes, however this made the compilation require sudo as well and therefor look in the wrong place for provisioning profiles.
This did the trick:
sudo gem uninstall rhodes
gem install rhodes

Creating a framework for iOS in XCode 4.2

I am trying to create a framework in XCode 4.2 for iOS applications.
I was developing my own Game framework. I was usually distributing only in source codes and resources but, due to using ARC in my framework, I had to distribute in static library and framework.
I haven't decided which shall I use yet.
Although developing framework for iOS is not a supported way, It's better that distributing resources and headers and Mach-O file in one directory(same as framework).
So I want to use framework to distribute my Game framework.
I used this script to create a Framework.
It seems that I have success creating a framework and copy mach-O and headers and resources.
But this framework's resources couldn't be added to the application which I added this framework.
#!/bin/bash
set -o errexit
set -o nounset
# Environment Variables
PANKIA_DIR="${SRCROOT}/Pankia"
PANKIA_CORE_DIR="${PANKIA_DIR}/Core"
PANKIA_PLATFORM_DIR="${PANKIA_DIR}/Platform"
FRAMEWORK_NAME="Pankia"
FRAMEWORK_VERSION=A
FRAMEWORK_VERSION_NUMBER=1.0
FRAMEWORK_BUILD_PATH="${SRCROOT}/build/${CONFIGURATION}-framework"
FRAMEWORK_DIR="${FRAMEWORK_BUILD_PATH}/${FRAMEWORK_NAME}.framework"
FRAMEWORK_PACKAGE_NAME="${FRAMEWORK_NAME}.${FRAMEWORK_VERSION_NUMBER}.zip"
FRAMEWORK_TARGET_NAME="libPankia"
# Clean directories
rm -rf "${FRAMEWORK_BUILD_PATH}"
# Build simulator and device binaries.
xcodebuild -project ${PROJECT_NAME}.xcodeproj -sdk iphonesimulator${IPHONEOS_DEPLOYMENT_TARGET} -target ${FRAMEWORK_TARGET_NAME} -configuration ${CONFIGURATION} clean build
xcodebuild -project ${PROJECT_NAME}.xcodeproj -sdk iphoneos${IPHONEOS_DEPLOYMENT_TARGET} -target ${FRAMEWORK_TARGET_NAME} -configuration ${CONFIGURATION} clean build
# create framework directories.
mkdir -p ${FRAMEWORK_DIR}
mkdir -p ${FRAMEWORK_DIR}/Versions
mkdir -p ${FRAMEWORK_DIR}/Versions/${FRAMEWORK_VERSION}
mkdir -p ${FRAMEWORK_DIR}/Versions/${FRAMEWORK_VERSION}/Resources
mkdir -p ${FRAMEWORK_DIR}/Versions/${FRAMEWORK_VERSION}/Headers
# create symlinks
ln -s ${FRAMEWORK_DIR}/Versions/${FRAMEWORK_VERSION} ${FRAMEWORK_DIR}/Versions/Current
ln -s ${FRAMEWORK_DIR}/Versions/Current/Headers ${FRAMEWORK_DIR}/Headers
ln -s ${FRAMEWORK_DIR}/Versions/Current/Resources ${FRAMEWORK_DIR}/Resources
ln -s ${FRAMEWORK_DIR}/Versions/Current/${FRAMEWORK_NAME} ${FRAMEWORK_DIR}/${FRAMEWORK_NAME}
# create the universal library
lipo ${SRCROOT}/build/${CONFIGURATION}-iphoneos/lib${FRAMEWORK_TARGET_NAME}.a ${SRCROOT}/build/${CONFIGURATION}-iphonesimulator/lib${FRAMEWORK_TARGET_NAME}.a -create -output "${FRAMEWORK_DIR}/Versions/Current/${FRAMEWORK_NAME}"
# copy files
cp ${PANKIA_PLATFORM_DIR}/GameInterface/Pankia.h ${FRAMEWORK_DIR}/Headers/
cp ${PANKIA_PLATFORM_DIR}/Models/Native/*.h ${FRAMEWORK_DIR}/Headers/
cp ${PANKIA_CORE_DIR}/Models/Native/*.h ${FRAMEWORK_DIR}/Headers/
cp -r ${PANKIA_PLATFORM_DIR}/Resources ${FRAMEWORK_DIR}/Resources/
cp -r ${PANKIA_PLATFORM_DIR}/RetinaResources ${FRAMEWORK_DIR}/Resources/
cp ${SRCROOT}/libPankia/Info.plist ${FRAMEWORK_DIR}/Resources/
# cp ${SRCROOT}/build/${CONFIGURATION}-iphoneos/usr/local/include/*.h ${FRAMEWORK_DIR}/Headers/
# cp Info.plist ${FRAMEWORK_DIR}/Resources
# zip (配布用に TestFramework.framework ディレクトリをZIP圧縮するだけなので、配布しないなら以下はコメントアウトしてもよい)
# cd ${FRAMEWORK_BUILD_PATH}
# zip -ry ${FRAMEWORK_PACKAGE_NAME} $(basename $FRAMEWORK_DIR)
Do you know why?
And is there any better way to distribute my framework?
Here is a helpful tutorial on creating frameworks. I have used it and have been able to package resources with the framework.
http://codefriend.blogspot.com/2011/09/creating-ios-framework-with-xcode4.html