I recently wanted to try React Native to code applications. This requires many installations which worked fine, except for AndroidStudio.
I use a Windows 10 PC, with hybrid hard drive.
I had to download AndroidStudio files on the second drive (D:) because my first hard drive is very small and already full. This type of installation never caused any problems with me (I installed dozens of softwares on D: like this).
I followed diligently React Native Getting Started Guide to install everything on windows for android devices. I ran into several problems :
Firstly, the Android Studio installer never asked me if I wanted a Custom or regular installation. I think this is not an issue as I can still install what's needed afterwards via the SDK manager.
Once I installed everything in the SDK manager and in the AVD manager as asked in the tutorial, I placed the path for ANDROID_HOME in environment variables menu (I also tried in system variables, in both, but this doesn't seem to change anything), and the Path for platform-tools in the Path variable.
One particularity is that I have the following files :
D:/AndoidStudio containing the app (that would have installed itself in C:/Program Files otherwise)
D:/AndroidStudio_sdk containing the downloaded sdk (Android Studio makes it mandatory to install these files in a different folder)
Then, when I clicked on the green triangle from AVD manager to start the emulator, nothing happened, and I received a Notification in Android Studio's IDE :
Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
I tried to add this environment variable pointing to the same location as ANDROID_HOME (D:/AndroidStudio_sdk). This hasn't solved the problems and made a new error pop up instead of the first one :
Emulator: PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [D:\AndroidStudio_sdk]!
I looked up on React Native website and it appears that ANDROID_SDK_ROOT environment variable is in this case used when there's no SDK files inside the ANDROID_HOME location.
What I can't understand is why I can't find the sdk location ? I tried in SDK manager, but it just gives me D:\20_AS_sdk, which is just the value of ANDROID_HOME.
Another particularity is that I can't find the sdk folder inside D:\20_AS_sdk (or any default route evoqued on different tutorials).
I really don't understand these issues and I've been blocked on this since 2 days, the only useful comments I found on other threads were just :
- set your ANDROID_HOME variable to the proper place, which I already did
- install the SDKs and emulator needed, but I did it too without issues
I tried to remove everything from AndroidStudio and the linked paths and reinstall everything, many many many times unsuccesfully...
Thank you for your support :)
Related
I made optimization of disk size (simply delete all trash) and when i try to use expo cli - i get typical issue : "Can't open emulator , make it manually from D:/AndroidSdk/..." . I try to resolve this problem with reset SDK Manager, but it doesn't help, so i launch emulator from Android Studio (before i do it from expo host ). And i get another error, that doesn't make my fix-way more clearly : "Unable to locate adb.exe" . After that i try to reassign some enviroment variables (Like Adb in PATH), that might not have correct way, well - it doesn't work too. So in this time i reset all Android Studio and related garbage (excluding enviroment variables) . So what i get in last attempt :
Expo :
Classical variable :
Path :
By the way try to run with expo client:install:android - no result (evidently);
And after this manipulation expo (above) doesn't recognize my real phone Imao - casual error "Check Metro logs"
It seems you are missing a few environment variables.
ANDROID_AVD_HOME
This should point to a folder named avd (e.g C:%USERNAME%.android\avd)
JAVA_HOME
While JAVA_HOME can point to any java run time environment, I found that having it point the one Android Studio provides to be a pain saver. I once ran into a problem where my builds were failing and I had no idea why. After a lot of sturggle, I found that the java I had independently installed somehow conflicted with what react native was trying to do. Using the java provided by Android Studio made this problem never occur again (e.g. C:\Program Files\Android\Android Studio\jre)
ANDROID_HOME & ANDROID_SDK_ROOT
For me ANDROID_HOME and ANDROID_SDK_ROOT point to the same folder
In PATH you need the point to the platform-tools and tools of the sdk folder. For an example, if the Android sdk folder was stored at E:\Android\sdk you would add:
E:\Android\sdk\tools
E:\Android\sdk\platform-tools
Also keep in mind that Windows being Windows, uses '\' and not '/'. I'm not sure if they sanitize this in environment variables, but I try not to risk it
If this doesnt resolve your problems, try running react-native doctor, as this may print a more verbose reasons react-native is failing (I'm just comparing my environment variables to what you show in your question)
I have been trying to use android studio and every time I deploy an app on a device, it gives me an error saying:
Installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error).
In order to proceed, you have to uninstall the existing application.
I have tried using Build->Clean Project and yet it seems to do no good.
I have also tried deleting the file from /data/local/tmp on device (as my phone is a rooted one), but, all in vain.
If anyone knows a way out, please, please help.
Uninstall the application from the device.
Check the storage space.
Once Restart the mobile and try to install it
I need to update my Windows Phone application tile by downloading and parsing JSON. So I'm using Microsoft HTTP Client Libraries.
And I've always got the exception Use of networking APIs requires the ID_CAP_NETWORKING capability to be defined in the application manifest when I'm trying to debug background task.
But my manifest included ID_CAP_NETWORKING as required (screenshot https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-xaf1/t31.0-8/10750111_821340111262044_6461333323674658178_o.jpg).
I don't know what to do. I tried rebuild or recreate the app, but this didn't help. Also I can't find any documentation or an answer on the internet.
Can you please write, what can I do to solve this problem?
This is demo project http://1drv.ms/1yjHm49 with reproduced problem (project's name is 'Meduza. Windows Phone').
I debug my application on Lumia 720 (if it can help).
I re-downloaded your project and now I get your error. So I thought, I must of done something before launching your project that fixed it.
It took me while, but I can get your project to work by doing this
Unzip project to directory
Open Project
Clean Project
Add Internet (Client and Server) in Package.appxmanifest file (make sure you save it before exiting)
Put the break points in your background task
And it works. So a combination of Clean Build + editing the Package.appxmanifest did the trick for me.
In MonoDevelop when compiling and running an app developed for Android against the simulator, the app compiles then crashes immediately in the simulator with the following application output...
E/mono ( 225): The assembly mscorlib.dll was not found or could not be loaded.
E/mono ( 225): It should have been installed in the `/home/jon/Development/xamarin/mono/BUILD/armeabi/install/lib/mono/2.0/mscorlib.dll' directory.
Keep in mind that I'm not Jon so I don't even know where it's getting the /home/jon path configuration. Though I have found that path in other similar but ultimately unrelated searches on the internet so I imagine it's a path on some other devs machine.
mscorlib.dll is indeed on my machine. located here...
/Developer/MonoTouch/usr/lib/mono/2.1/
and here...
/Developer/MonoAndroid/usr/lib/mono/2.1/
I've tried targetting various Android SDK environments (currently 2.3 and the simulator is currently running under the 2.3 SDK environment as well).
I'm on Mac OSx 10.7.2. Using the latest version of MonoDevelop, Mono and Mono for Android. I've also got the latest MonoTouch installed as well and iPhone apps compile fine if that's worth anything.
The closest thing I can find to a hint at the issue is here...
http://phonicuk.com/Forums/ViewThread.aspx?tid=401
I've tried reinstalling Mono and Mono for Android but admittedly have not tried uninstalling in entirely before a reinstall. I've searched within files for the /home/jon path thinking that it must be a configuration somewhere but haven't been able to find it anywhere.
I found this... Mono return error: mono mscorlib.dll was not found
Along with a few other things that were sort of in the same vein, but ultimately nothing that seems to be a fix.
Any ideas?
Update: From the suggestions in jonp's answer below it indeed seems like the Mono.Android.DebugRuntime package is not installed. So far I've tried a couple of MonoAndroid reinstalls and have tried removing MonoAndroid entirely beforehand. I'm trying to figure out if there is a way to add the package manually, but I'm so new to this.
Another update: Not sure why I didn't try this already, but I created a HelloWorld MonoAndroid app and it works fine. The compilation took a while longer too for that one and I could see if was setting up the required packages, so there has to be an issue with the specific solution.
When you install a Debug build of your app on the device, three .apk files are installed:
Mono.Android.DebugRuntime, which contains libmonosgen-2.0.so, mscorlib.dll, etc.
Mono.Android.Plaltform.ApiLevel_N, which contains Mono.Android.dll for API level N.
Your application.
My guess is that the Mono.Android.DebugRuntime package has not been installed. To check this, run:
adb shell pm list packages | grep Mono.Android
I'm going to guess that it's missing. :-)
Next, why is it missing? When you Run the app within MonoDevelop, all required packages are checked for and installed. It seems rather odd that it wouldn't be. Is your device low on disk space?
adb shell df /data
How are you launching the emulator? If you're launching within MonoDevelop, there should be enough free space to install all of the above packages. However, if you launch it yourself, the default /data size is 64MB, which isn't enough to support a Debug build environment. Please launch the simulator from MonoDevelop and re-Run your app, or launch the emulator so that it has enough free space:
emulator -partition-size 512 -avd YOUR_AVD_NAME
I've found various proposed solutions to this problem on this internet, but none of them work for me. Does anyone know why this might be happening?
http://answers.unity3d.com/questions/15294/xcode-build-and-archive-error-no-such-file-or-directory
http://blog.joshschumacher.com/2011/04/06/xcode4-the-operation-couldn%E2%80%99t-be-completed-no-such-file-or-directory/
I've tried archiving with every combination of coding signing vs not using code signing, and I've tried using every combination of provisioning profiles, but I still get the same error every time.
I'm very confused as to why I'd even be getting an error like this when trying to save a file. I'm using XCode 4, my application builds for archive fine. In fact, I can even upload my application to itunesconnect (and it was accepted!). I just can't create an IPA for sharing and beta testing before submission.
Any ideas?
The error message
Right before I get the error
After much frustration, I filed a developer support request with Apple. The technician I spoke with was able to save my archive as an .ipa on her computer -- the exact same archive that I was not able to save on mine, which pointed to a possible bug in my system (and from the sounds of it, many other people's).
She recommended that I uninstall and reinstall XCode and the developer tools, and that worked!
Here were her uninstall instructions:
Make sure that your machine is running the latest Mac OS X (10.6.7) and iTunes.
Run the following command in the Terminal application to uninstall your SKD:
sudo <Xcode>/Library/uninstall-devtools --mode=all (where <Xcode> is the path to the directory that contains your SDK.)
Drag your <Xcode> to the trash and restart your machine
Re-download and install Xcode (4.0.2) from the iOS Dev Center. Make sure that the System Tools, UNIX Development, Essentials packages in the Custom Install pane are selected before installing it.
I have the same issue after my distribution certificate was expired. I add new ones (private key and certificate) and xCode "Share" command starts to produce such error.
The problem resolves as soon as I remove old private key & certificate from Keychain Access.
Hope it helps
Selecting "Don't Re-sign" at Identity solved the same issue for me.
I actually had the same problem, but a different solution (and reason). I had Xcode 3 and Xcode 4 both running at one point. I recently deleted Xcode 3 and moved my Xcode 4 from /Xcode4 to /Developer directory. This caused me to have the same issue you describe.
I moved the directory back to /Xcode4 and now my archives save out correctly.
I also had the same problem but I could resolve the problem in the below way.
My project was on the portable disk (formatted as FAT-32) and the project referred some folders on the same disk as "add folder reference for any added folder". I could build it any configurations however I couldn't just make .ipa file with above alert.
So, I copied the referenced folders on the portable disk to the desktop of the disk installed XCode (MacOS). And adding again the folders into the project. I could make .ipa file.
I installed Xcode 4.0.2 in one directory and then manually moved it to another.
When I moved Xcode back to the first directory everything worked.