Build Issue on windows and ubuntu


#1

I have built a blank ionic application,
Ionic .gitignore file excludes plugins folder by default.
When I commit my project and someone else tries to build it, it raises an error telling it need android.json file. When I commit plugin folder this issue is resolved, but after going through adding android platform and build process, when I try to run my project it gives me this runtime error:

W/System.err( 7460): java.lang.ClassNotFoundException: com.ionic.keyboard.IonicKeyboard

W/System.err( 7460): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ionic.keyboard.IonicKeyboard" on path: DexPathList[[zip file "/data/app/com.ionicframework.myblank127625-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.ionicframework.myblank127625-1, /vendor/lib, /system/lib]]

E/AndroidRuntime( 7460): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime( 7460):        at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:191)

this problem happens if I try to create a new project on ubuntu and try to run it on windows, or vice versa.
But if I try to run the project on the same machine that I have created it on, it works perfectly.
Can any one help me?


#2

Hi @pazel,

When you build on Android, the path to your SDK folder is added to the local.properties file in your Android platforms directory. I’m guessing the SDK doesn’t exist in the same place on both machines.

When building between machines I’d resist committing your platforms sub directories.


#3

Hi @nicraboy,

Ionic does not commit the platform folder in the first place, so I don’t think that’s our issue.
when I looked at the local.properties file you were referring to I saw that it says:

# This file is automatically generated.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!

I think there might be something wrong with locating android keyboard plugin at runtime.
Maybe it’s a classpath issue, since the project compiles on both machines, and runs on one machine with no errors.
What do you think?


#4

I had the same problem: working with a partner in different computers. The problem is with the file

plugins/com.ionic.keyboard/.fetch.json

as you can see in the next image they are different:

We resolved this problem by removing and adding again the plugin in each computer with Cordova:

cordova plugin remove com.ionic.keyboard

Hope it helps :wink: