Fixing win32Exeption in Unity for Mac - unity3d

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

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

(Unity3d) Chartboost and Admob can't Compatible

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

System.DllNotFoundException in pocketsphinx swig Unity windows build

Goal:
Obtain a wrapper dll to use pocketsphinx in a Unity project in Windows.
Problem:
When running the test program, I get an annoying System.DllNotFoundException even though the .so file is in the same directory as the mono program.
Setup and attempted actions:
For starters, I am using Cygwin. I was able to build absolutely everything, sphinxbase and pocketsphinx no problem. Then I went into the swig/csharp directory and attempted make. It does make, a .so file is created. I am using the default Makefile and make in cygwin. Rules 1-3 run perfectly fine, building, linking and everything. So does the pocketsphinx_continuous test.
pocketsphinx.c: ../pocketsphinx.i
mkdir -p gen
swig -I.. -I../../../sphinxbase/swig -I../include -I../../sphinxbase/include \
-csharp \
-dllimport "libpocketsphinxwrap.so" \
-namespace "Pocketsphinx" -o sphinxbase.c \
-outdir gen ../../../sphinxbase/swig/sphinxbase.i
swig -I.. -I../../../sphinxbase/swig -I../include -I../../sphinxbase/include \
-csharp \
-dllimport "libpocketsphinxwrap.so" \
-namespace "Pocketsphinx" -o pocketsphinx.c \
-outdir gen ../pocketsphinx.i
libpocketsphinxwrap.so: pocketsphinx.c
gcc -fPIC pocketsphinx.c sphinxbase.c `pkg-config --libs --cflags pocketsphinx` -shared -o $#
test.exe: libpocketsphinxwrap.so
mcs test.cs gen/*.cs
run: test.exe
MONO_LOG_LEVEL=debug mono test.exe
clean:
rm -rf gen
rm -f libpocketsphinxwrap.so
rm -f pocketsphinx.c
rm -f sphinxbase.c
rm -f test.exe
.PHONY: run clean
When attempting mono test.exe - the following happens:
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Pocketsphinx.PocketSphinxPINVOKE' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: libpocketsphinxwrap.so
The .so is in the same directory as the test.exe file and is certainly being looked at because when running mono with MONO_LOG_LEVEL=debug, the output is:
Mono: DllImport error loading library 'C:\Users\fgera\Development\Tools\CMUSphinx\pocketsphinx\swig\csharp\libpocketsphinxwrap.so.dll': 'The system cannot find the file specified.
Many times over and over.
Any help will be greatly appreciated. Again, I need a libpocketsphinx.so x86_64 for windows in Unity to interop with the C# files.
Thanks.
--- edit - added relevant snippet. test.cs just calls this method from the wrapper data structure. These files were all generated by SWIG.
[global::System.Runtime.InteropServices.DllImport("libpocketsphinxwrap.so", EntryPoint="CSharp_Pocketsphinx_Decoder_GetConfig")]
public static extern global::System.IntPtr Decoder_GetConfig(global::System.Runtime.InteropServices.HandleRef jarg1);
I doubt Cygwin DLL is compatible with Mono/Unity. You need to create DLL in Visual Studio, then it will work.
Why do you test the so file with mono, while it is actually used in Unity?
Mono: DllImport error loading library 'C:\Users\fgera\Development\Tools\CMUSphinx\pocketsphinx\swig\csharp\libpocketsphinxwrap.so.dll': 'The system cannot find the file specified.
If file libpocketsphinxwrap.so does exist in C:\Users\fgera\Development\Tools\CMUSphinx\pocketsphinx\swig\csharp\, try rename libpocketsphinxwrap.so to libpocketsphinxwrap.so.dll so mono can find it.
See also mono pinvoke: library names and DllNotfoundException.
You can try build pocketsphinx with Visual Studio since it is offically supported.
BTW, I'd rather write the C# wrapper myself instead of using SWIG since there are many traps in P/Invoke and I don't think SWIG can handle all of them.

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.

Problem provisioning iPhone after 3.0.1 update

I used to be able to run my application on my iPhone that was running 3.0. After I updated to 3.0.1 I get the error:
No Provisioned iPhone OS Device is Connected.
I followed Apple's guide in the terminal:
ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\) /
Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1
but that didn't help.
Make sure that you don't paste it into Terminal as you currently have it (and as Apple have it in their PDF). It should be one line, not two.
ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\) /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1
not
ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\) /
Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0.1
Allow you need to do is duplicated the folder at /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\) and rename it to 3.0.1