Phonegap - build for android -> Class not found: javac1.8 - android

I have been trying for 2 days to sort out this problem I am having with phonegap/cordova.
Working on a mac, I can build for iOS. But everytime I try to build for android, I get this error:
BUILD FAILED
/Users/m/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:601: The following error occurred while executing this line:
/Users/m/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/m/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:734: Class not found: javac1.8
Any help would be great!! No online resources has helped!

Do you have java sdk/JDK installed in your mac? you may try javac -version in your terminal and check the results.
you can also refer to http://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html

Easy to solve, look at error message:
.../sdk/tools/ant/build.xml:734: Class not found: javac1.8
So open this file, on line 734, and you find fork="${need.javac.fork}"> . What's need.javac.fork? I don't know, but let's search this in document and we got this on line 199:
<condition else="false" property="need.javac.fork">
<and>
<matches pattern="1\.[56]" string="${java.specification.version}"/>
<not>
<os family="unix"/>
</not>
</and>
</condition>
Whoa, pattern="1\.[56]" ?? It looks like this pattern is about Java 1.5 and 1.6, what If I change this to pattern="1\.[8]" ? Now it will build and works like a charm!!!
Some people said this is related because the ant version is old and doesn't support Java 8..or you need to install Java 1.6.. and yes doing this works too, but we programmers need to read error messages and be at least a little bit curious to understand and try to solve too, I spent a minute or two to find and solve this problem... just by reading the error message!

Related

NativeScript Build - Error executing Static Binding Generator: Class not found android.support.v4.view.ViewPager.OnPageChangeListener

I'm new to NativeScript and took over a project recently upgraded from NativeScript 4 to 6. Here is my environment detials:
Windows 10
Node v16.6.1
NativeScript 8.0.2
Android Studio 11 (with al
the recommended updates to date)
VS Code 1.58.2
I can create a new Native script project with "tns create" and build/run it in the simulator just fine. However, when I try to run the project the build throws the following error:
java.lang.RuntimeException: Class not found android.support.v4.view.ViewPager.OnPageChangeListener
at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java:551)
at org.nativescript.staticbindinggenerator.Generator.getInterfacesFromCache(Generator.java:534)
at org.nativescript.staticbindinggenerator.Generator.writeBinding(Generator.java:283)
at org.nativescript.staticbindinggenerator.Generator.generateBinding(Generator.java:171)
at org.nativescript.staticbindinggenerator.Generator.processRows(Generator.java:234)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:121)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:97)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:55)
Here is the run command I'm using: "tns run android --emulator"
I have tried tons of things and searches but no luck resolving this issue.
So I had an idea and searched with a different search engine than I normally use. I did find some ideas which helped me resolved the issue.
I had previously searched in VSCode for variations on "android.support.v4.view.ViewPager.OnPageChangeListener", but only found the log file with the error. Then I learned you have to change the filter options of the find in file search otherwise the files you are looking for can be excluded from the search results. I also used Baregrep to confirm I was getting everything.
I fixed the issue by replacing all occurrences of:
android.support.v4.view.ViewPager with androidx.viewpager.widget.ViewPager
Also you may need to install widgets:npm i tns-core-modules-widgets
Since the files where I made the changes were all non-project files (many of them in the node_modules directory) there is probably something else that involves updating Node or NativeScript that may solve this as well.
If someone else figures that out, I'll be watching this thread for updates, and thanks in advance!
Fissh

Deploy Apps with Ionic Package

I figured i would try the 'new' CLI tool for Ionic, Package, but i am getting some weird errors that i haven't seen before.
When running the command :
ionic package build android --profile release
The error i am getting
undefined:0
^
SyntaxError: Unexpected end of input
at Object.parse (native)
at /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/io-config.js:179:28
at fs.js:271:14
at Object.oncomplete (fs.js:107:15)
After some research i found that this can happen when a command is run without sudo, but when running the command with sudo i am getting the dam error message.
Hopefully i am lucky and ill find an Ionic enthusiast who might help me with the matter. Couldn't find any Ionic related topics where this error was mentioned.
Any help appreciated!
I had to add [] to the .io-config.json file in the root directory of my ionic app.
Btw. dont forget to install ionic add ionic-platform-web-client
The solution for me was annoyingly simple. In the file mentioned, find the line where CONFIG_BACKUP is defined and change it. You should see that it is:
var CONFIG_BACKUP = './.io-config.json'
It should actually be:
var CONFIG_BACKUP = './io-config.json'
I was building for iOS but had the same error as you which disappeared after the above.
For me the error resulted from the config.xml file. I would open all ionic files to make sure there are no formatting errors. The rebuild

Game Maker: Studio Android Not Compiling

So I'm using GameMaker Studio Pro: 1.4.1657. I've installed all necessary SDKs, NDKs and other permissions. However, I cannot create and executable(.apk) for android.
Here is what the console says:
BUILD FAILED
C:\Android\tools\ant\build.xml:649: The following error occurred while executing this line:
C:\Android\tools\ant\build.xml:694: null returned: 1
Total time: 15 seconds
I've tried this solution: link Which didn't work.
Thanks! I would've posted this in the yoyogames forums, but I can't post! Thanks very much!

What is LT_INIT(...) in Linux?

I'm customizing linphone (open source voip dialer).
When I build linphone-android from source, some errors occurr.
Problematic path is "submodules/libilbc-rfc3951/Makefile".
Error is like this:
./configure: line 2521: syntax error near unexpected token `disable-static'
./configure: line 2521: `LT_INIT(disable-static)'
What is 'LT_INIT(disable-static)'?
And... What should I do about this?
It looks very complicated to me.
As Aduait had mentioned, http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html will explain what is LT_INIT(...).
Regarding the LinPhone-Android build issue, You got to remove submodules/libilbc-rfc3951/ and try to run make or prepare_source.sh respectively. It will fetch the right code for compilation.
I personally faced the same issue and the above method fixed my problem.
I was able to defeat this one by going to submodules/libilbc-rfc3951/ and running these commands:
aclocal
autoconf
automake --add-missing

Could not find com.slidingmenu.lib.SlidingMenuActivity.apk

I am trying to make use of the SlidingMenu Library for Android but I get these errors:
Could not find com.slidingmenu.lib.SlidingMenuActivity.apk
and another error:
E/AndroidRuntime(24767): java.lang.NoClassDefFoundError: com.slidingmenu.lib.SlidingMenu
I have properly added the com.slidingmenu.lib.SlidingMenuActivity to the Java Build section.
What I found is that some time between June 2012 and now (August 2013) the package name changed. Performing a global search-and-replace of com.slidingmenu.lib to com.jeremyfeinstein.slidingmenu.lib fixed the problem.
Troubleshoot Android 'Could not find somelibrary.apk'
Could not find Library.apk!
Troubleshoot Android 'java.lang.NoClassDefFoundError com.somelibrary.mylibrary'
Troubleshoot NoClassDefFoundError in Java

Categories

Resources