edit configuration of NDK_builder - android

I have two NDK project in my eclipse, and I want to configure NDK_builder for them.
I've finished the configure for the first project, by [Project->Properties->Builders->New] step and edit the configuration. The builder name is NDK_builder.
Anyway, when I try to apply this procedure to my second project, in the edit configuration step, when I try to name my builder 'NDK_builder', here comes the error: ' A 'Program' configuration with this name already exists'.
So, should I change the builder's name for this project? And the builders' name of each project are not the same? That is quite unconvinient.
Could anyone help me with that? Thank you!

Same error, had to create a second builder.
I just appended the project name like so: "NDK Builder for [project name]".

There is a Bug Report for that error - https://bugs.eclipse.org/bugs/show_bug.cgi?id=365232
Martin Larente CLA Friend 2011-11-30 13:42:36 EST
It seems that Eclipse is unable to create an external builder that has the same name of another project's external builder, even though the corresponding launch configuration is saved in the project folder.
This is the answer:
Michael Rennie CLA Friend 2011-11-30 16:23:13 EST
This is because launch configurations have a flat naming scheme. See also bug 59289. This bug has been marked as a duplicate of bug 59289
Also see https://bugs.eclipse.org/bugs/show_bug.cgi?id=59289 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=400126

Related

Application is not Registered in react native

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

mobile-chrome-apps --link-to "Hello World" default

using the switches:
cca create YourApp --link-to=path/to/manifest.json
The packaged *.apk is built from the default create namespacing of "HelloWorld" and not "YourApp".
A cursory rename gave me INSTALL_PARSE_FAILED_MANIFEST_MALFORMED errors.
It seems a bit brittle. Is there something in the cca toolchain for this?
If not which files need to be changed?
Can someone with a 1500pt reputation add a tag mobile-chrome-apps please?
Thanks,
Nic
The argument YourApp is not the name of the application, but the folder where it is created. The name of your application is specified inside manifest.json and the Android packageId inside the manifest.mobile.json.
After you create your application (whether using --link-to or just starting with the default), modify those files and run cca prepare. The name and packageId should be correctly updated.
(Caveat: there are some leftover bits that don't get cleaned up, we have an open bug, but it should not impact you)
Probably your problem is because you have used capital letter in your project name:
Com.Example.PackageName
Try again using only low letter:
com.example.packagename
It should work!

How to generate javadocs for android project

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.

Cannot compile system app (Phone) using maven - EventLogTags cannot be resolved

this is related to my previous question. I'm trying to build Phone application from android 4.0.4 using maven (I'm adding framework_intermediates as dependency, so internal apis problems are solved), and I ran into this problem. Some parts of the logs are as follows:
Phone/src/com/android/phone/CallNotifier.java:[601,32] cannot find symbol
symbol : variable EventLogTags
(the corresponding line in CallNotifier.java is: EventLog.writeEvent(EventLogTags.PHONE_UI_MULTIPLE_QUERY); )
Phone/src/com/android/phone/InCallScreen.java:[723,28] cannot find symbol
symbol : variable EventLogTags
(the corresponding line in InCallScreen.java is: EventLog.writeEvent(EventLogTags.PHONE_UI_ENTER); )
So... it cannot find the class EventLogTags. There is actually a file Phone/src/com/android/phone/EventLogTags.logtags which has the following contents:
# See system/core/logcat/event.logtags for a description of the format of this file.
option java_package com.android.phone;
70301 phone_ui_enter
70302 phone_ui_exit
70303 phone_ui_button_click (text|3)
70304 phone_ui_ringer_query_elapsed
70305 phone_ui_multiple_query
Apparently, this file tells the system to use some particular tags to log important events in the system. I did a full grep, but could not find any file which defines the values PHONE_UI_ENTER, PHONE_UI_MULTIPLE_QUERY, etc. These are just logs, so I could just comment out these and get it working. But I don't want to do this because I need to build this inside the entire aosp later on. So my question is, how do I get this to compile using maven, without modifying any file?
The Android build system code-generates a Java class out of .logtags files if needed. See: https://github.com/android/platform_build/blob/master/core/base_rules.mk
You will need to decipher the make rules and run that code generation yourself, I imagine.

Eclipse: Conversion to Dalvik format failed with error 1

This happens instantly when I make a new project in Eclipse.
I only have 1 jar file in the project, I have tried to remove it, and add it again, several times, and cleaned the project after this.
I have updated ProGuard (I think), downloaded the new version, and replaced the lib folder as the threads on here said.
My default.properties file looks like this:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8
So can't comment anything about ProGuard which was also mentioned in another thread.
I feel I have tried everything, and still this bug.
One thing I have noticed though if I go to:
window -> preferences -> android -> build. And uncheck "Force error when external jars contain native libraries". Then I get: "Can't resolve R" instead of the Dalvik error.
There is no import named android.R either.
Anyone with some help please?
This doesn't look like the issue with proguard, since it's not even enabled in your defaults.properties file. Try the following:
Uncheck "Force error when external jars contain native libraries" option (just as you did)
Select "Project -> Clean…" from the menu
If that won't help ensure you have the correct R class imported. As stated at source.android.com:
Eclipse sometimes likes to add an import android.R statement at the
top of your files that use resources, especially when you ask eclipse
to sort or otherwise manage imports. This will cause your make to
break. Look out for these erroneous import statements and delete them.
UPDATE
Have a look also at this thread: "Conversion to Dalvik format failed with error 1" on external JAR.
Check the following answers (link will bring you directly to the answer):
michel's answer
user408841's answer
Mido's answer
Joe's Apps' answer
I had mistakenly added a reference to a copy of android.jar, which was not required as it is an android dependency, I removed this and the error went away.
I started having this problem as well... The only thing that fixed it for me was manually downlaoding the newest version of ProGuard (currently 4.6) and replacing the SDK's version of Proguard's bin and lib folders with the newest verison.
After that everything started working again. This is apparently a logged bug...
http://code.google.com/p/android/issues/detail?id=18359
Do you have the new Android SDK? If you do, you have to download the proguard.jar from the proguard website and replace it on the SDK directory.
I just was fighting with this problem myself what I ended up doing is editing the proguard.bat file and the problem vanished
it's in: [Android SDK Installation Directory]\tools\proguard\bin\proguard.bat
Change
call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %*
to
call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
I tried tons of other stuff but this is what did it for me.
You have to clean your project every time if you use CVS update.
I have had this problem occasionally and the fix for me is to switch off 'Build Automatically'. In my experience, Eclipse sometimes gets confused when building apks when automatic building is switched on.
If none of the solutions work for you try to do the following:
Stop looking for online help.
Turn to your project. It can be something in the code that Dalvik interprets in wrong way even if there are no reported errors during the run of application.
I had such a problem. Multiple runs/builds/exports of application with Proguard disabled were successful and only after enabling Proguard an error 1 appeared.
Following steps can help you to resolve the problem:
Create a new project.
In order to detect the suspicious class, begin adding your classes one by one every time running the export signed application tool.
Narrow the search in that class by adding blocks of code to it also one by one.
In my case the error was caused by:
float[][] array1 = null, array2;
for(int i = 0; i < someVal; i++){
if(array1 == null){
array1 = new float[row][col];
}
else{
array2 = new float[array1.length][array1[0].length]; // ERROR 1
// it was assumed that array1 is still null
}
}
When I replaced it with:
float[][] array1 = new float[1][1], array2;
for(int i = 0; i < someVal; i++){
if(i == 0){
array1 = new float[row][col];
}
else{
array2 = new float[array1.length][array1[0].length]; // ERROR 1
// it was assumed that array1 is still null
}
}
the ERROR 1 disappeared.
I've tried many solutions on stackoverflow but nothing worked for me.
I just open the project.properties file in project folder and appcompat library was added twice here like
android.library.reference.1=../appcompat_v7
android.library.reference.1=../appcompat_v7
I just removed one line and this worked for me :)

Categories

Resources