Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build fails #180

Closed
fabioz23 opened this issue Mar 1, 2016 · 16 comments
Closed

Android build fails #180

fabioz23 opened this issue Mar 1, 2016 · 16 comments

Comments

@fabioz23
Copy link

fabioz23 commented Mar 1, 2016

Running command: /Users/fabio/Downloads/zmNinja/hooks/before_prepare/01_pp_hacks.sh /Users/fabio/Downloads/zmNinja
----------------------------------------------------
Pliable Pixels build pre-preprocessing
----------------------------------------------------
Curr Dir: /Users/fabio/Downloads/zmNinja
Copying Modified GCMIntentService for custom sound
$ cp www/external/GCMIntentService.java plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/
$ cp www/external/GCMIntentService.java platforms/android/src/com/adobe/phonegap/push
cp: platforms/android/src/com/adobe/phonegap/push: No such file or directory
Copying custom sound
---------------------
Directory platforms/android does not exist, skipping...
Copying plist hack for iOS for non SSL connections
--------------------------------------------------
$ cp www/external/zmNinja-Info.plist.IOS9nonSSLPatch platforms/ios/zmNinja/zmNinja-Info.plist
Copying Android notification icons to resource dir
--------------------------------------------------
Directory platforms/android/res/ does not exist, skipping...
Fixing insecure SSL permission problem
--------------------------------------------------
Directory platforms/android/CordovaLib/src/org/apache/cordova/engine does not exist, skipping...
$ cp www/external/AppDelegate.m platforms/ios/zmNinja/Classes/
Running command: /Users/fabio/Downloads/zmNinja/hooks/before_prepare/02_jshint.js /Users/fabio/Downloads/zmNinja
Linting www/js/DataModel.js
File www/js/DataModel.js has no errors.
-----------------------------------------
Linting www/js/DevOptionsCtrl.js
File www/js/DevOptionsCtrl.js has no errors.
-----------------------------------------
Linting www/js/EventCtrl.js
File www/js/EventCtrl.js has no errors.
-----------------------------------------
Linting www/js/EventDateTimeFilterCtrl.js
File www/js/EventDateTimeFilterCtrl.js has no errors.
-----------------------------------------
Linting www/js/EventModalCtrl.js
File www/js/EventModalCtrl.js has no errors.
-----------------------------------------
Linting www/js/EventServer.js
File www/js/EventServer.js has no errors.
-----------------------------------------
Linting www/js/EventServerSettingsCtrl.js
File www/js/EventServerSettingsCtrl.js has no errors.
-----------------------------------------
Linting www/js/EventsGraphsCtrl.js
File www/js/EventsGraphsCtrl.js has no errors.
-----------------------------------------
Linting www/js/FirstUseCtrl.js
File www/js/FirstUseCtrl.js has no errors.
-----------------------------------------
Linting www/js/HelpCtrl.js
File www/js/HelpCtrl.js has no errors.
-----------------------------------------
Linting www/js/ImportantMessageCtrl.js
File www/js/ImportantMessageCtrl.js has no errors.
-----------------------------------------
Linting www/js/LogCtrl.js
File www/js/LogCtrl.js has no errors.
-----------------------------------------
Linting www/js/LoginCtrl.js
File www/js/LoginCtrl.js has no errors.
-----------------------------------------
Linting www/js/LowVersionCtrl.js
File www/js/LowVersionCtrl.js has no errors.
-----------------------------------------
Linting www/js/MonitorCtrl.js
File www/js/MonitorCtrl.js has no errors.
-----------------------------------------
Linting www/js/MonitorModalCtrl.js
File www/js/MonitorModalCtrl.js has no errors.
-----------------------------------------
Linting www/js/MontageCtrl.js
File www/js/MontageCtrl.js has no errors.
-----------------------------------------
Linting www/js/MontageHistoryCtrl.js
Errors in file www/js/MontageHistoryCtrl.js
618:11 -> 'i' used out of scope. ->     for ( i=0; i< $scope.MontageMonitors.length; i++)
618:16 -> 'i' used out of scope. ->     for ( i=0; i< $scope.MontageMonitors.length; i++)
618:50 -> 'i' used out of scope. ->     for ( i=0; i< $scope.MontageMonitors.length; i++)
624:40 -> 'i' used out of scope. ->                 $scope.MontageMonitors[i].Monitor.connKey =  (Math.floor((Math.random() * 999999) + 1)).toString();
625:40 -> 'i' used out of scope. ->                 $scope.MontageMonitors[i].Monitor.eventUrl ='img/noevent.png';
626:40 -> 'i' used out of scope. ->                 $scope.MontageMonitors[i].Monitor.eventUrlTime="";
627:40 -> 'i' used out of scope. ->                 $scope.MontageMonitors[i].Monitor.isPaused=false;
-----------------------------------------
Linting www/js/NewsCtrl.js
File www/js/NewsCtrl.js has no errors.
-----------------------------------------
Linting www/js/PortalLoginCtrl.js
File www/js/PortalLoginCtrl.js has no errors.
-----------------------------------------
Linting www/js/StateCtrl.js
File www/js/StateCtrl.js has no errors.
-----------------------------------------
Linting www/js/TimelineCtrl.js
File www/js/TimelineCtrl.js has no errors.
-----------------------------------------
Linting www/js/app.js
File www/js/app.js has no errors.
-----------------------------------------
Linting www/js/controllers.js
File www/js/controllers.js has no errors.
-----------------------------------------
Linting www/js/ionicUtils.js
File www/js/ionicUtils.js has no errors.
-----------------------------------------
Error: Hook failed with error code 1: /Users/fabio/Downloads/zmNinja/hooks/before_prepare/02_jshint.js
@fabioz23
Copy link
Author

fabioz23 commented Mar 8, 2016

what can I check for this error?

@pliablepixels
Copy link
Member

I'm sorry I don't know - I don't see the error when I build it.
In general, if you are building from source, the expectation is you know how to fix things. In your case, since I don't see the error, try just adding a var i right after var readyToRun = false; around like 482

@fabioz23
Copy link
Author

fabioz23 commented Mar 8, 2016

in which file?

@fabioz23
Copy link
Author

fabioz23 commented Mar 8, 2016

renaming the i var in the for statement the errors are gone but the build process is still failing with another error:

....
....
Linting www/js/MontageHistoryCtrl.js
File www/js/MontageHistoryCtrl.js has no errors.
-----------------------------------------
Linting www/js/NewsCtrl.js
File www/js/NewsCtrl.js has no errors.
-----------------------------------------
Linting www/js/PortalLoginCtrl.js
File www/js/PortalLoginCtrl.js has no errors.
-----------------------------------------
Linting www/js/StateCtrl.js
File www/js/StateCtrl.js has no errors.
-----------------------------------------
Linting www/js/TimelineCtrl.js
File www/js/TimelineCtrl.js has no errors.
-----------------------------------------
Linting www/js/app.js
File www/js/app.js has no errors.
-----------------------------------------
Linting www/js/controllers.js
File www/js/controllers.js has no errors.
-----------------------------------------
Linting www/js/ionicUtils.js
File www/js/ionicUtils.js has no errors.
-----------------------------------------
Error: The provided path "/Users/fabio/Downloads/zmNinja-1.0.9/platforms/android" is not an Android project.

@pliablepixels
Copy link
Member

Hi, I am not sure how you have set up your environment - doesn't look like you have initialized an ionic android directory. Have you compiled this before ? I'd suggest you directly use the binaries for desktop if you are not comfortable at a code level.

@fabioz23
Copy link
Author

fabioz23 commented Mar 8, 2016

Yes, I've built the ver 1.0.3.

I would build the android version for my phone.

How can I solve?
My system info:

Cordova CLI: 6.0.0
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Version: 1.1.0
Ionic CLI Version: 1.7.0
Ionic App Lib Version: 0.5.1-beta.0
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v4.2.3
Xcode version: Xcode 7.2.1 Build version 7C1002

@fabioz23
Copy link
Author

fabioz23 commented Mar 8, 2016

Executing the steps on the wiki I obtain the error above.

Are you sure that there's anything to do in addition?

@pliablepixels
Copy link
Member

try

cd /Users/fabio/Downloads/zmNinja-1.0.9
ionic platform add android

then build

@fabioz23
Copy link
Author

fabioz23 commented Mar 8, 2016

schermata 2016-03-08 alle 19 57 22

@fabioz23
Copy link
Author

fabioz23 commented Mar 8, 2016

the build process ends with the same error

@pliablepixels
Copy link
Member

not sure what is going on in your environment - I just checked out an new copy and it worked (with the gcm.jar install). You might want to delete and do a fresh checkout?

@fabioz23
Copy link
Author

fabioz23 commented Mar 8, 2016

same situation on another pc with osx and a fresh install of node, android sdk, etc.

@pliablepixels
Copy link
Member

Im sorry - you'll have to resolve this on your own for now - I can't replicate it - if you are not comfortable with code debugging, I suggest not going the source compilation way as tools and versions change over time and I am only testing with what versions I have. I don't have the bandwidth at this stage to debug source compilation issues that I can't replicate here. In future, when I upgrade all my libraries I will be more upto date.

@3esmit
Copy link

3esmit commented Mar 9, 2016

You need to create a keystroke to sign APK. Configure your build envoirment as described in ionic framework documents. If you are trying to build just to use the app, please stop wasting time and buy the app at playstore. If you are willing to contribute in source code development I can help you fix your build environment.
If you want to test the app use the desktop version.

@fabioz23
Copy link
Author

fabioz23 commented Mar 9, 2016

I've tried on a fresh mac (third pc), installed xcode, node, android studio. Then i've installed npm packages.
I've installed ionic 1.7.0 as suggested in other issues.

But when I launch: ionic build android
I obtain:

Error: The provided path "/Users/fabio/Downloads/zmNinja/platforms/android" is not an Android project.

System info:

Cordova CLI: 6.0.0
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Version: 1.1.0
Ionic CLI Version: 1.7.0
Ionic App Lib Version: 0.5.1-beta.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v4.3.2
Xcode version: Not installed

This isn't a single machine related problem, everyone follows the step on a newly installed environment can obtain this problem!

It's sad reading that you aren't interested on finding new problems.

@fabioz23
Copy link
Author

fabioz23 commented Mar 9, 2016

How can I obtain more info from ionic during the command "ionic build android"?

It print only the error related to a non android project path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants