I've just updated to the new sdk platform version 11 and tools version 10 and they now generate invalid .apk files. Eclipse doesn't complain until I try and install it, then says
Android Launch!
adb is running normally.
Could not find someapp.apk!
This is because the apk is messed up. Using adb install someapp.apk we see
EOCD not found, not Zip
Note, I'm building against 2 referenced libraries.
Please help me resolve this issue.
I've spent the day looking for an answer, and much to my chagrin was unable to find answer. I did narrow the culprit down to either Eclipse 3.4 or Ant though.
My reasoning: Ant 1.8 is needed to use the command line tools, I updated and could build via command line. Eclipse has plugins for 1.7 though, so builds still failed.
To solve this, I updated to Eclipse 3.6 and everything works now. Hopefully this helps someones else.
Related
I have looked EVERYWHERE for the solution to this.
Ionic Cordova Build Android No installed build tools found did not work
cordova build android failed with exception was a ridiculous non-answer. OF COURSE Android Studio is installed!!!
Android studio- "SDK tools directory is missing" I did this. The $ANDROID_SDK_ROOT/tools folder now exists, but that didn't solve my problem.
I tried the advice given here: Ionic Cordova Build Android No installed build tools found and all I get when I run sdkmanager packages "build-tools;30.0.3" is "failed to find package 'packages'" from the SDK Manager.
I looked here: Android SDK Manager does not exist and installed ALL the stuff they said to install -- including the obsolete packages. And still no luck.
Here's my path:
/opt/homebrew/bin:/Users/lmacneill/.sdkman/candidates/java/current/bin:/Users/lmacneill/.sdkman/candidates/gradle/current/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/lmacneill/CordovaProjects/gamapp/node_modules/.bin:/Users/lmacneill/Library/Android/sdk/tools:/Users/lmacneill/Library/Android/sdk/build-tools:/Users/lmacneill/Library/Android/sdk/platform-tools
Here's my Android Studio SDK Platforms screen:
https://i.stack.imgur.com/2e5YI.png
And here's my Android Studio SDK Tools screen:
https://i.stack.imgur.com/btLIR.png
(Unrelated to this post, but very weird -- it told me I needed 10 reputation to post images, yet I have 661 reputation. Why did it do that? Hence the link to my images instead of the actual images.)
SO WHY CAN THE TOOLS NOT BE FOUND?!!!!!!. I've done EVERYTHING that EVERYONE has suggested, and STILL IT DOESN'T WORK!!!!
This is ridiculous!!!! Surely someone must know the answer?
Well... I FINALLY figured it out...
In the $ANDROID_SDK_ROOT/build-tools folder, there was a 33.0.2 folder. So in my .zshrc file, instead of adding $ANDROID_SDK_ROOT/build-tools to the path, I needed to add $ANDROID_SDK_ROOT/build-tools/33.0.2 to the path.
Then cordova build android FINALLY worked!!!
BTW, I figured this out when I finally got sdkmanager to install the build-tools;30.0.3 -- you have to use sdkmanager "build-tools;30.0.3" command, NOT the sdkmanager packages "build-tools;30.0.3" command. Maybe the command with the 'packages' bit worked for an older version of sdkmanager? But it definitely doesn't work now. Anyway, once I saw that it had created a new folder in $ANDROID_SDK_ROOT/build-tools, I finally realized that exporting only $ANDROID_SDK_ROOT/build-tools in the path wasn't enough. You have to include the version folder in there as well.
ANDROID!!! Y'ALL SHOULD MAKE THIS EASIER!!!! INSTALLING ANDROID STUDIO SHOULD DO ALL OF THIS STUFF AUTOMATICALLY!!!!!
I'm on windows7 x64, installed today's latest stable release of android sdk studio (through android studio bundle, since it's shipped together now apparently). I have properly configured the environment variables as you'll see above.
This is what I get when issuing the following command
$ cordova build android
ANDROID_HOME=G:\installs\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: G:\installs\Android\sdk\tools\templates\gradle\wrapper
And indeed, the "templates" directory doesn't even exist in my sdk install.
I've already tried the suggestions (setting the right path, uninstall/reinstall) of this question here but nothing applies to my case, and I find that manually copying and pasting packages is not really a solution, since there's a package manager in place.
If anybody has an answer as of today's android install, would be very much appreciated.
If still not working then copy all file from gradle\wrapper from Android Studio installation folder
C:\Program Files\Android\Android
Studio\plugins\android\lib\templates\gradle\wrapper
and paste it in your Android SDK gradle\wrapper then run same command.
E:\android-sdk\tools\templates\gradle\wrapper
This is a known issue; see CB-12544. For now you'll need to downgrade.
I downloaded Android SDK r25 manually and placed templates folder inside Android/sdk/tools. This solved the issue for me.
You can get it from https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip
For Windows:
https://developer.android.com/studio/index.html
Go to the section :"Get just the command line tools"
There is a link 'sdk-tools-darwin-3859397.zip' for Mac, Unfortunately that didn't have the templates folder with Gradle Wrapper. So for Mac users, i will suggest not to go for this zip.
I am new to Xamarin for visual studio , when I tried to build the auto generated app from visual studio 2015 without any editing it just did not build and those errors occurred :
*Severity Code Description Project File Line Suppression State Error The file "obj\Debug\android\bin\packaged_resources" does not exist. App1
*Severity Code Description Project File Line Suppression State
Error "aapt.exe" exited with code -1073741819. App1
I tried many solutions from those who had the same problem but I can't seem to find any solution that actally works for me.
One additional detail that is not mentioned but might be a part of the problem is that the resource files can only contain 'a'-'Z', '0'-'9' and '_' characters. A single resource file can ruin the whole build, which is exactly what happened to me. I suggest to anyone running into this mistake to double check the file names of resources.
Same problem with me. It seems it´s a bug.
Lots of posts out there:
https://forums.xamarin.com/discussion/65862/i-cant-build-any-android-project
At this one I´ve seen a light and worked for me:
https://bugzilla.xamarin.com/show_bug.cgi?id=39910
In short:
Close VS
DEL your folder C:\users\\appdata\local\xamarin
DEL your project sub-folders BIN and OBJ at Droid and IOS
Use Nuget to update your projects packages
Update Android Studio SDK if neccessary
Reopen VS and rebuild your solution.
I hope you have same luck... It was really annoying...
Please let us know. Bye.
Ran into the same problem. After toiling on it for a while, I finally found a viable solution. Apparently, this is like caused by a bug in Android Build Tools 24.0.0. And removing those from the system should solve the problem. A bug has been reported, you can find more details on the link below:
https://releases.xamarin.com/technical-bulletin-android-sdk-build-tools-24/
Installing an older "Android SDK build tools" Version was the solution for me.
Start the SDK Manager (in VS 15):
Tools -> Android -> Android SDK Manager ..
Install "Android SDK Build-tools" version 23.0.1
Uninstall all other "Android SDK Build-tools" versions
Build -> rebuild the project / workspace
(Even safer: run a clean, restart VS, run build)
This was successful with:
Android SDK Tools 25.2.3
Android SDK Platform Tools 25.0.1
Android SDK build tools version 23.0.1
If that works, you can test newer build tools.
Please do not mark this questions as a duplicate - I have diligently searched SO for a satisfactory answer and have found nothing that worked for me.
I downloaded the very latest version of the Android Studio and attempted to install it on two Windows 7 PC's - a laptop and desktop with identical configurations of JRE and JDK. Results:
laptop: can use Android Studio to build/run first Hello World app; everything seems fine.
desktop: Hello World builds successfully, but will not run. Reports gradle error:
:app:preDexDebug
The system cannot find the path specified.
I have spent 3 days now researching this error on SO and elsewhere and have tried everything suggested (edit dx.bat, edit find.java.bat, JAVA_PATH, gradlew --stop etc) but nothing works for me.
Configuration:
- Android SDK Tools 24.0.1
- Android SDK Platform Tools 21
- Android SDK Build Tools 21.1.2
I am on the verge of giving up on my desktop installation of Android Studio.
Any new suggestions?
Please help!
This has something to do with an error in your Gradle build process. You'll need to clean the project and rebuild to fix this. An easy way to do this is from the root folder of your project run ./gradlew clean
I am using,
Version: Helios Service Release 2
Build id: 20110218-0911
When I try to run the project1 I get the following error.
'Lauching project1' has encountered a problem.
Errors occured during the build.
Errors occurred during the build.
Errors running builder 'Android Package Builder' on project 'project1'.
sun.security.x509.X500Name.
Can someone guide me on to resolve this issue?
Regards,
Subbu
I have same problem, because I use IBM JRE first time. Then I re-install all of them by follow up the installing guide order:
Install Sun JDK firstly, then install SDK manager and make sure it find Sun JDK location, then install Eclipse Classic,etc.
user671253 pointed to a solution that worked for me. That is, installing the Oracle JDK 7u11, and then pointing Eclipse to its JRE :
Go to Windows > Preferences > Java > Installed JREs. Point it to the Sun JDK (Sun JRE might work but I used JDK). Then restart the workbench.
i would recommend getting the "eclipse classic" and installing android plugin to it instead of trying using the eclipse Java EE and other versions. Eclipse seems to break if too many plugings are loaded, that my experiance with android in eclipse.