I would like to extract my app in .apk format.
I add these script on my "package.json" page:
"build:development:android": "ionic cordova build android"
and "build:production:android": "ionic cordova build android --prod --release".
But, when I type the commands I have Errors.
What I should do to have my .apk file?
I am novice. Any help would be much appreciated. Thanks.
aha! I can see the problem in your code !
you are generating pages from ionic generate command! but if you see the file structure you will find that the page folder has its own module file! first delete that and then go to yourPage.ts file and delete the import of ionicPage and also remove the Annotation of ionic page.... Repeat this step for all pages which have this module file in them!
after that make sure your pages are imported in your app.module.ts
here lemme show you an example how it is done! consider I have a class called testerClass. its page structure on using
ionic g page testerClass will be as
delete that tester-class.module.ts
Step 2: AFTER deleting that you have to go into tester-class.ts and
remove the annotation and import of ionic page like shown in picture
**
NOTE!!make sure you run the build commands using admin/root pre villages (if you are not using root account just in case). in simple words search your cmd in windows search option right click and open as administrator
**
I think you encounter 2 problems and I will try to refer to them based on the screenshots.
Screenshot #1: I believe this is a permissions error, if you run the same command as an admin do you have the same result? In order to run it as an admin you will:
type 'cmd' in your search bar bottom at the windows bar
when the results emerge, right click on the command line and hit 'run as administrator'
Screenshot #2: This is a code error but it is simple to fix.
It seems that you have added the Album page via ionic generate page AlbumPage but then added that to your app.module.ts.
The result is that AlbumPage is declared on both app.module.ts and album.module.ts.
Since AlbumPage is built to be an Ionic Page (if you navigate in album.ts, right above Component annotation, you will se the IonicPage() annotation) you can remove it from the app.module.ts, and wherever you are referring to this page you can use the string of the name e.g. this.setRoot('AlbumPage'), instead of this.setRoot(AlbumPage), which also means that you do not have to import it.
Related
I have a react native application and I changed the package name of the application using https://www.npmjs.com/package/react-native-rename. After that I tried to run the project but its saying that the application is not registered. I have tried the following steps also.
Opened the project in android studio and make sure that the package name is changed and all the files are also in the same package name.
Tried cleaning the old gradle files.
Uninstalled the previously installed version of the app (The one which have the original package name.
Any help would be appreciated. Thanks in advance
You need to check 2 files to make sure you have equal names there:
index.js -> application name in the last line:
AppRegistry.registerComponent('YourAppName', () => App);
app.json -> name property
In both places names should be equal (case sensitive).
Have you changed the values in the index.ios.js, index.android.js and app.json files?
There are some instructions here.
android\app\src\main\java\com{someFolderName}\MainActivity.java
you landed up on this answer because still you are not able to solve the issue
open the file mentioned in above in title
this used for
Returns the name of the main component registered from JavaScript.
This is used to schedule rendering of the component.
look for method
#Override
protected String getMainComponentName() {
return "AddYourNewNameHere";
}
which might be returning a hard coded string replace it to desired name!!
EXTENDED TIP
ensure you clean your gradle demon as the project does not compile sometimes
for that use following
cd android
gradlew clean
Jenkins successfully create build for Android and then uploads to an S3 server. The build contains environment name, version number that is different for each build. These version number, environments are read from POM profiles. An example URL of s3 http://example.com/android/staging/ABC-Project-v0.1.58-staging-aligned.apk
I get the file name by this
cd $WORKSPACE/target/
FILE_NAME=$(echo *aligned.apk)
So my link will be http://example.com/dev/FILE_NAME
But this is only visible in shell script. I want to use this in an email template so that the Software test engineers can access it. I was looking for a way in which I can temporarily assign this value to a variable and then put that in the email template.
Email template is:
<html>
<body>
<h3>$PROJECT_NAME</h3>
<h4>Build #$BUILD_NUMBER - $BUILD_STATUS</h4>
<h4>${CAUSE}</h4>
<h4>$DEFAULT_CONTENT</h4>
<h4>Git Branch: ${GIT_BRANCH}</h4>
Changes since the last build:
${CHANGES}
</body>
</html>
Assuming that the email step is a later part of the Jenkins build process, you'll need to use the EnvInject plugin. From its own example use cases you can: inject variables as a build step obtained from a file filled in by a previous build step.
You could set these when parsing your POM (either in Maven directly, or you could parse it manually with something like a build step using the Groovy plugin and XmlSlurper (we do this actually)), and then they'd be available as environment variables (e.g. $CHANGES, $CAUSE etc) for your email templater script later on.
OK, I'm about to offer two things that are kind of ugly but working perfect:
In both you can put the output (the link you want) in a /tmp/job.output.tmp file and then:
use the post build task plugin - when the work ERROR or EXCEPTION or whatever you want is there, run sendEmail from bash to the people you want with the context of the file.
a little bash and everything is great.
this is probably more nice: use the https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin editable mail notification to send your users the console output / the file in zip / not zipped as you like when the build fails / stable again and such. They have so much options..
I'm trying to add the android platform using this command "platform add android error" but I get this error: http://i.imgur.com/C3ShDqn.png
My user folder is "C:\Users\Cretu Eusebiu" but in that error it's says only "C:\Users\Cretu" so I guess is something wrong with the space ?
I've set all paths for npm, android, ant and java.
Thank you.
It was not because of my username with spaces, it was from the spaces of the path where I created the app "C:\Google Drive\Android Apps".
I followed all the instruction given on stackflow, but unfortunately not able to generate doc file for my android project.
If I am not mentioning class path on last step of java doc generation, then getting "Android reference" error.
And if using it, then getting "javadoc: error - The -classpath option may be specified no more than once." error.
Using classpath:
-classpath "D:\Android 4.2 SDK\android_sdk\platforms\android-15\android.jar"
Am I using correct class path command ?
Please help me out.
Environment used:
Eclipse indigo
If you use Intellij IDEA go to Tools - Generate JavaDoc... Specify all the settings and set params: -bootclasspath [path]\android-sdk\platforms\android-{version}\android.jar -encoding UTF-8 -docencoding utf-8 -charset utf-8
More information is in this post.
Have You followed these steps (from www.mtholyoke.edu)? This works on my Project....if not and You get an error, please write here which error You get.
Project -> Generate Javadoc
In the "Javadoc command" field - browse to find javadoc.exe
• On the computers in the Clapp CS lab that is C:\JBuilderX\jdk1.4\bin\javadoc.exe
• On other computers it would be \bin\javadoc.exe
Check the box next to the project/package/file for which you are creating the javadoc
In the "Destination" field browse to find the desired destination (for example, the root directory of the current project).
Leave everything else as it is.
Click "Finish"
Javadoc should be in the destination folder. Open "index.html"
EDIT
I found a thread here in Stackoverflow with a lot of tipps, try this:
Javadoc in Eclipse failing to recognize packages
NEXT EDIT
It is only a possibility, but You specified Your classpath as:
"D:\Android 4.2 SDK\android_sdk\platforms\android-15\android.jar"
I know that eclipse got some problems with spaces inside a path. So the first part "Android 4.2 SDK" has to be specified without spaces, maybe here is the issue. But be aware, if You change this path, You have to set everywhere the new path where You have definded it.
I'm using the command line. I have also updated to Eclipse Kepler. It seems to execute javadoc differently? I'm investigating. But try this:
read the javadoc manual. It's confusing and doesn't tell you what to do, but, here's an example that should get you going.
Create a file called "options"
Add to the file this:
-d target-bin
-stylesheetfile style.css
-use
-splitindex
-windowtitle 'My Project Name Class Specification'
-doctitle 'My Project Name Class Specification'
-header '<b>My Project Name</b><br><font size="-1">0.1.5-alpha</font>'
-bottom 'Copyright 2014 My Company or Myself. All rights reserved.'
-group "Group Of Packages" "com.mypackage.*"
-overview overview.html
-exclude 'android'
-subpackages 'com.mypackage:android'
-charset utf-8
-encoding UTF8
-quiet
-sourcepath ../myProject/src;..\..\..\android-sdks\sources\android-19
Then on the command line type:
javadoc #options
Now, in Kepler, the "Generate Javadoc" dialog box says "What is the javadoc command line"...I suspect I'll have to type something like this. But don't know.
Hopefully this quick example will give you a start on how to get it done for your purposes.
By the way, I created a generic Eclipse project called "javadoc" in my Workspace so I could manage the files.
I'm trying to get PhoneGap working. I've hit a hurdle getting started.
I've downloaded version 0.9.1. I've been following the instructions at http://phonegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse
Using MacOS 10.5.8. Android SDK is already installed and working with Eclipse.
My .bash_profile file looks like this:-
$PATH=/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
export PATH=${PATH}:/Applications/android-sdk-mac_86/tools
export PATH=$PATH:/Applications/phonegap-android/bin
(and I restarted my terminal window to make it take effect)
I've tried the following command:-
cd /Applications/phonegap-android/bin
ruby ./droidgap /Applications/android-sdk-mac_86 HelloPhoneGap com.myidentity.android /Users/myidentity/Documents/workspace/HelloPhoneGap/assets/www /Users/myidentity/Desktop
...and I get the following error:-
./droidgap:4:in `require': no such file to load -- /Applications/phonegap-android/bin/lib/generate.rb (LoadError)
from ./droidgap:4
Why?
I ran into this issue as well, move droidgap up one level into the phonegap base directory.
Or, you should mention the complete path:
export PATH=$path: /Applications/phonegap-android/bin/**droidgap**
I came across such issues too. go to https://github.com/jonathanstark/phonegap-android, search the generate.rb file in the lib folder there, download it, then you are good to go.