android,c++,opencv,android-ndk,native , Android NDK OpenCV - No implementation found for native


Android NDK OpenCV - No implementation found for native

Question:

Tag: android,c++,opencv,android-ndk,native

can you help me handle my errors? I have read a lot of tips how to fix them but nothing helped me. I also know that there are similar question already asked but they didnt help me. So I give a chance to ask you:

I am trying to make Android application what takes Image from gallery and call native function written in c++ to make it grey.

In my main activity is:

static {
        if(!OpenCVLoader.initDebug())
        {
            Log.e("tom", "Tomasku opencv problem static");
        }
        else
        {
            Log.e("tom", "OPENCV NACITANE");
            System.loadLibrary("halgorithm");
        }
    }

***In the same Activity I call another activity(EditorActivity):

Intent i = new Intent(this, EditorActivity.class);
                ...
                i.putExtra("path", selectedImagePath); //path to image from gallery
                startActivity(i);

***In my EditorActivity:

...
public native int fce(long matAddrRgba, long matAddrGray);
...

fce(image.getNativeObjAddr(), image_gray.getNativeObjAddr());
// and here it crashes

**In my halgorithm.cpp

#include <jni.h>
#include <string.h>
#include <stdio.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc_c.h"

//using namespace std;
using namespace cv;

extern "C"
{

JNIEXPORT jint JNICALL Java_com_example_hematoma_MainActivity_fce(JNIEnv*, jobject, jlong addrRgba, jlong addrGray) {

    Mat& mRgb = *(Mat*)addrRgba;
    Mat& mGray = *(Mat*)addrGray;

    int conv;
    jint retVal;

    conv = toGray(mRgb, mGray);
    retVal = (jint)conv;

    return retVal;

}

}

int toGray(Mat img, Mat& gray)
{
    cvtColor(img, gray, CV_RGBA2GRAY); // Assuming RGBA input

    if (gray.rows == img.rows && gray.cols == img.cols)
    {
        return 1;
    }
    return 0;
}

**In my Android.mk

include $(CLEAR_VARS)

OPENCV_INSTALL_MODULES:=on
OPENCV_CAMERA_MODULES:=on
include /home/nemesis/adt-bundle-linux-x86_64-20140702/OpenCV-2.4.10-android-sdk/sdk/native/jni/OpenCV.mk

LOCAL_MODULE := halgorithm
LOCAL_SRC_FILE := halgorithm.cpp

LOCAL_C_INCLUDES := /home/nemesis/adt-bundle-linux-x86_64-20140702/OpenCV-2.4.10-android-sdk/sdk/native/jni/include

include $(BUILD_SHARED_LIBRARY)

***LogCat

04-30 13:16:28.320: W/dalvikvm(3863): No implementation found for native Lcom/example/hematoma/EditorActivity;.fce (JJ)I
04-30 13:16:28.320: D/AndroidRuntime(3863): Shutting down VM
04-30 13:16:28.320: W/dalvikvm(3863): threadid=1: thread exiting with uncaught exception (group=0x40185760)
04-30 13:16:28.320: E/AndroidRuntime(3863): FATAL EXCEPTION: main
04-30 13:16:28.320: E/AndroidRuntime(3863): java.lang.UnsatisfiedLinkError: fce
04-30 13:16:28.320: E/AndroidRuntime(3863):     at com.example.hematoma.EditorActivity.fce(Native Method)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at com.example.hematoma.EditorActivity$3.onClick(EditorActivity.java:166)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at android.view.View.performClick(View.java:3110)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at android.view.View$PerformClick.run(View.java:11934)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at android.os.Handler.handleCallback(Handler.java:587)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at android.os.Handler.dispatchMessage(Handler.java:92)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at android.os.Looper.loop(Looper.java:132)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at android.app.ActivityThread.main(ActivityThread.java:4123)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at java.lang.reflect.Method.invokeNative(Native Method)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at java.lang.reflect.Method.invoke(Method.java:491)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
04-30 13:16:28.320: E/AndroidRuntime(3863):     at dalvik.system.NativeStart.main(Native Method)

Thanks in advance!

****************************EDITED***********************

After your suggestions I changed:

***In Android.mk:

JNIEXPORT jint JNICALL 
Java_com_example_hematoma_**EditorActivity**_fce(JNIEnv*, jobject, jlong addrRgba, jlong addrGray) {...}

***In EditorActivity: I am calling System.loadLibrary("halgorithm") before native methode.

static {
        if(!OpenCVLoader.initDebug())
        {
            Log.e("tom", "Tomasku opencv problem static");
        }
        else
        {
            Log.e("tom", "OPENCV NACITANE");
            System.loadLibrary("halgorithm");
        }
    }

But it didnt fixed my error. There is the same error :/

***LogCat

04-30 13:36:21.760: W/dalvikvm(4255): No implementation found for native Lcom/example/hematoma/EditorActivity;.fce (JJ)I
04-30 13:36:21.760: D/AndroidRuntime(4255): Shutting down VM
04-30 13:36:21.760: W/dalvikvm(4255): threadid=1: thread exiting with uncaught exception (group=0x40185760)
04-30 13:36:21.760: E/AndroidRuntime(4255): FATAL EXCEPTION: main
04-30 13:36:21.760: E/AndroidRuntime(4255): java.lang.UnsatisfiedLinkError: fce
04-30 13:36:21.760: E/AndroidRuntime(4255):     at com.example.hematoma.EditorActivity.fce(Native Method)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at com.example.hematoma.EditorActivity$3.onClick(EditorActivity.java:166)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at android.view.View.performClick(View.java:3110)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at android.view.View$PerformClick.run(View.java:11934)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at android.os.Handler.handleCallback(Handler.java:587)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at android.os.Handler.dispatchMessage(Handler.java:92)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at android.os.Looper.loop(Looper.java:132)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at android.app.ActivityThread.main(ActivityThread.java:4123)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at java.lang.reflect.Method.invokeNative(Native Method)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at java.lang.reflect.Method.invoke(Method.java:491)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
04-30 13:36:21.760: E/AndroidRuntime(4255):     at dalvik.system.NativeStart.main(Native Method)

Answer:

After few days of hopelessness :D I solve my problem. The issue was that $(OPENCV_INSTALL_MODULES) should be equal. At the line OPENCV_INSTALL_MODULES:=on in my Android.mk file.

I overrided OPENCV_INSTALL_MODULES:=on

to

OPENCV_INSTALL_MODULES=on

and now it works.... Perhaps it might help to someone else too :)


Related:


custom arraylist get distinct


java,android
is there any way to get the distinct values of a custom arraylist? public class mystatistic extends BaseActivity { public String objectid; public String playerid; public String playername; public String enemyid; public String enemyname; public String question; public mystatistik(String objectid, String playerid, String playername, String enemyid, String enemyname, String question)...

Implicit use of initializer_list


c++,c++11,initializer-list
§[dcl.init.list] 8.5.4/2: The template std::initializer_list is not predefined; if the header <initializer_list> is not included prior to a use of std::initializer_list — even an implicit use in which the type is not named (7.1.6.4) — the program is ill-formed. Does that mean this program is ill-formed? #include <vector> int main()...

dispatch response packet according to packet sequence id


c++,boost,boost-asio
I have a third-part server, and I'm writing a dll interface for it, my clients use my dll to communicate with the server. The protocol uses a long tcp connection, all traffic goes from this tcp connection. There could be sending/receiving multiple packets at the same time, like a send_msg...

How can I convert an int to a string in C++11 without using to_string or stoi?


c++,string,c++11,gcc
I know it sounds stupid, but I'm using MinGW32 on Windows7, and "to_string was not declared in this scope." It's an actual GCC Bug, and I've followed these instructions and they did not work. So, how can I convert an int to a string in C++11 without using to_string or...

how does android ImageView resize my image?


android
I have some 100*100 icons and I cannot find better resolution icons so I put them inside drawable folder. The width and height of the image view are set to wrap_content. When the image is shown on a xhdpi screen will the image be scaled to 200*200 automatically? or should...

Blank screen on GridView


android,arrays,gridview
I'm trying to create a GridView with an array of strings. These are XML, and MainActivity and Adapter, but what I get is a blank screen. I'm change the background, but the result is the same, but clicking on a point on the screen appears to me the toast stating...

Crop does not work for gallery images


android,image,crop
I am using the following code to crop images from camera and gallery : private void doCrop() { final ArrayList<CropOption> cropOptions = new ArrayList<CropOption>(); Intent intent = new Intent("com.android.camera.action.CROP"); intent.setType("image/*"); List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, 0); int size = list.size(); if (size == 0) { Toast.makeText(this, getApplicationContext().getString(R.string.crop_unavailable), Toast.LENGTH_SHORT).show(); // return }...

Get element starting with letter from List


java,android,list,indexof
I have a list and I want to get the position of the string which starts with specific letter. I am trying this code, but it isn't working. List<String> sp = Arrays.asList(splited); int i2 = sp.indexOf("^w.*$"); ...

error: cannot find symbol class AsyncCallWS Android


java,android,web-services
I'm trying to rewrite the application in this, in Android Studio link, which is written in Eclipse. There are two problems, first problem is there is this line in the project : import com.example.webserviceactivity.R; I couldn't write this one on Android Studio. The second problem is, in this part of...

Problems implementing ViewHolder pattern


android,design-patterns
I'm working on an android app from a book. I'm getting errors : "crimeHolder cannot be resolved" and I can't understand why.. public View getView(int poisition, View convertView , ViewGroup parent) { //If we weren't given a view, inflate one if (convertView == null) { convertView = getActivity().getLayoutInflater().inflate(R.layout.list_item_crime, null); ViewHolder...

Get current latitude and longitude android


java,android,gps,geolocation,location
Requirement: 1.Sometimes(not everytime) I am getting latitude and longitude 0.0. 2.I want to know how to get the location update after user has enabled the gps from the settings. Here is my code public class GPSTracker extends Service implements LocationListener { private final Context mContext; // flag for GPS status...

How to set speaker phone off when the app is killed by the “Recent App drawer”


android,android-audiomanager,ondestroy
I implemented an app which has a button speaker, which is manually set "on" by myAudioManager.setSpeakerphoneOn(true) and "off" vice-versa. But the bug is when you close the application while the speaker is on, it forgets the speaker was on. The next time, the speaker remains on and the call is...

How to resolve Out of Memory Error on Bitmap in Android?


android,android-intent,android-activity,bitmap
I want to set an image in image view,I am retrieving the image path in my first activity and I am passing it via intent as a String to second activity.In the second activity I set the path to an image view,It is working properly , and I need to...

Same function with and without template


c++,c++11
I am trying to understand a piece of code of C++11. A class contains 2 functions as shown below: class abc { public: void integerA(int x); template<typename typ> void integerA(typ x); }; I am unable to understand benefit of declaring 2 same functions. Why not declare only one template function?...

Fixed element in android?


android,xml,android-fragments
I am using a FAB(Floating action button) and a ViewPager that has a list inside a fragment. The ViewPager stops due to the FAB block and each are blocks the ViewPager being on top of the FAB activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:fab="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:fitsSystemWindows="true">...

Getting particular view from expandable listview


java,android,listview,android-fragments,expandablelistview
In my list view I have an textview in expandable group and I want to open the dialog when textview is clicked to fill the information through edittext and update textview. Problem: how could I get the groupview textview item in my fragment oncreateview() method....

Android set clickable text to go one fragment to another fragment


java,android,android-fragments,spannablestring
I need to do something like this. Suppose I have 2 fragments A and B.There is a text which can be clickable in fragment A and when user click this text , he can go to fragment B. This example helped me to do it but I think it does...

Floating Action Button in Xamarin.Forms


android,xamarin,monodroid,xamarin.forms,floating-action-button
I had completed my App's home page in Xamarin.Forms Portable. Now i want to add a Flotation Action Button In my Android Project ! Is there any way to add FAB for Android in my existing home page, which was coded in Xamarin.Forms Portable. OR I want to create a...

Is there any way to use a pre-existing database from Xamarin without copying it from Assets?


android,xamarin,xamarin.forms
I have a rather large SQLite database (~20 mb) I need to access from my Android Xamarin-Forms app. Everything online I've read says you can read the database by copying it to the filesystem first. For example, this question. However, won't that mean the large database is duplicated, wasting users'...

Android Espresso: Test running failed. No test results Empty test suite. Why?


android,android-espresso
Can't make my Espresso UI test work. Where's the problem? What result should I get for this simple app to consider that it's working? I have "android.support.test.runner.AndroidJUnitRunner" for Instrumentation runner in Edit Confirurations. From AndroidManifest.xml: <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner" android:targetPackage="my.package"/> From build.gradle: defaultConfig { applicationId "my.package" minSdkVersion 18 targetSdkVersion 22 versionCode 1...

Action Bar activity is closed


android,android-actionbar
What is wrong with my code? When I run application on my device/emulator my application is crashed " Unfortunately! Action Bar has stopped" public class Main extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ActionBar mActionBar = getActionBar(); assert mActionBar != null; mActionBar.setDisplayShowHomeEnabled(false); mActionBar.setDisplayShowTitleEnabled(false); LayoutInflater mInflater =...

How can I access the members of a subclass from a superclass with a different constructor?


c++,inheritance,constructor,subclass,superclass
I have the following class and typedef: class Object { protected: long int id; public: Object(void); ~Object(void) {}; long int get_id(void); }; typedef map<string, Object> obj_map; And then I have its child: class Image: public Object { private: path full_path; int x; int y; img image; public: Image(path p, int...

why is Android app publishing taking several days [on hold]


android,google-play,publishing
I have uploaded my app on the store 3 days ago and it status still : PENDING PUBLICATION I have uploaded all the app listing needed : description, screen shots ... and google didn't contact me on E-mail. does anyone had the same case before ???...

Undefined behaviour or may be something with memset


c++,undefined-behavior
I was trying to save the binary equivalent of a 32 bit number in an array A. For testing my showbits() function , I choosed 8,9 when I came across this thing: I am facing an unreasonable thing in my code when I am placing memset in the function showbits(),I...

android imageView scale


android,imageview,scale
I have an ImageView which is populated from database (the image comes from database). in the database i have images both portrait and landscape!! how can i adjust the imageView to scale it self according to the image width and height. I have tried many ways but no result! any...

Add more features to stack container


c++,visual-c++,stl
I am using default features(push, pop, top, empty, size) of stack container of STL. If I want to add more features like access an element from middle of stack. How could I do this? Thanks...

Why i get can not resolve method error in class android?


android,json
I use this tutorial: JSON and part of code to this: protected String doInBackground(String... urls) { TextView lbl=(TextView) findViewById(R.id.provCODE); person = new Person(); person.setName(lbl.getText().toString()); //person.setCountry("1853"); //person.setTwitter("1892"); return POST(urls[0],person); } but in the this line: person.setName(lbl.getText().toString()); i get this error: Can not resolve method. How can i solve that?what happen? my...

BitmapFont class does not have getBound(String) method


java,android,libgdx
Previously I used getBound method for BitmapFont class in libgdx, but now, I am unable to use it. I cannot find the changes in latest version. Any help is appreciated. Thank you...

.cpp:23: error: cannot convert ‘std::string’ to ‘const char*’ for argument ‘1’ to ‘int atoi(const char*)’


c++,string
Here a basic code I'm trying to run But I'm having trouble with stoi (it's c++) I keep getting error: ‘stoi’ was not declared in this scope I tried atoi and strtol with this error .cpp:23: error: cannot convert ‘std::string’ to ‘const char*’ for argument ‘1’ to ‘int atoi(const char*)’...

Keep HashMap with object data while app is idle - Android


android,android-activity
I have a HashMap that contains data relevant to a specific Activity. The problem is that when the app is opened after being idle for some time, the HashMap is empty. I am fetching all the data in the main activity and storing the corresponding objects in a HashMap in...

Dagger 2 Custom Scope for each Fragment


android,android-fragments,dagger-2
I'm a little confused about how to best use the custom scoping in Dagger 2. I've looked at a couple different articles which seem to suggest two different ways of doing it: MVP Presenters that Survive Configuration Changes Part-2 (Github repo): Uses unique custom scopes for each fragment, e.g. @Hello1Scope...

Can I install 2 or more Android SDK when using Eclipse


java,android,eclipse,sdk,versions
I am new to android developments. I am setting up my android development environment using Eclipse. I have a test smart phone with Android version 4.2.2. The automatic installation installed the latest Android SDK version, which is 5.1.1. My questions are: 1. Do I have to install the SDK version...

Set value for Spinner with custom Adapter in Android


android,dynamic,android-arrayadapter,android-spinner
I am developing a android application with spinner in a form. The spinner items and spinner values are different. I want to collect all the value from the from including spinner and set a rest api service to web back end. here is the response array. {"Status":true,"errorType":null,"countryList":[{"Code":"US","Name":"United States"},{"Code":"CA","Name":"Canada"},{"Code":"AU","Name":"Australia"},{"Code":"GB","Name":"United Kingdom"}]} I...

how to add menu items to action bar in more than 30 activities


android,android-activity,android-studio,menu,menuitem
I have created an app in android studio that has more than 30 activities .I created menu items in some activities by adding them in individual menu files and they worked fine . But the problem is that it is a real headache to add all the menu items in...

Is there any sdk to log exceptions, events and errors in production app?


android,logging,error-handling,sdk,production
I want to catch all the un expected/undesirable events in my app during production. I want something which can send a error log file to server and I can easily read it through a web application. Do you know anything of this sort ?

Marshal struct in struct from c# to c++


c#,c++,marshalling
I have the following structures in C# and C++. C++: struct TestA { char* iu; }; struct TestB { int cycle1; int cycle2; }; struct MainStruct { TestA test; TestB test2; }; C#: [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi, Pack = 1)] internal struct TestA { [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 36)] private string iu; public...

Unfortunately, (My app) has stopped. Eclipse Android [duplicate]


java,android,eclipse,adt
This question already has an answer here: What is a Null Pointer Exception, and how do I fix it? 12 answers I'm a beginner in android developing and I'm trying to build a simple app but I'm getting this error in the emulator.(Unfortunately,(App) has unexpectedly stopped). LogCat http://i.stack.imgur.com/VZhuL.png package...

Android String if-statement


java,android,string
I have a if-statement in the start of my app if (ready.equals("yes")){ ... } and later on my code I have ready="yes"; but the if statement is never called, why? The ready="yes"; is called from a background thread, is that why? public void DownloadFromUrl(final String fileName) { //this is the...

Translating a character array into a integer string in C++


c++,arrays,string
I was trying to achieve translating a character array into a integer string and corresponding character to their alphabetical order. For instance: A(a) = 0 , Z(z) = 25. string key_char = argv[1]; string key_num; for (int i = 0; i < key_char.length(); i++){ if (isalpha(key_char[i])){ if (islower(key_char[i])){ key_num[i] =...

Action view intent does not work


android,search-suggestion,custom-search-provider
Action view Intent for Search widget does not send Intent i am using Toast to show whether intent is sent when user choose item from suggestion in Quick Search Box here is snippet where intent is received in searchable Activity if (Intent.ACTION_VIEW.equals(intent.getAction())){ /* Intent countryIntent = new Intent(this, RecordActivity.class); countryIntent.setData(intent.getData());...

Twitter4j - cannot resolve method - setUsessl(boolean)


android,android-studio,twitter4j
I'm using twitter4j 4.0.3 core I have this code: public final class TwitterUtil { private RequestToken requestToken = null; private TwitterFactory twitterFactory = null; private Twitter twitter; private TwitterUtil() { ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); configurationBuilder.setOAuthConsumerKey(ConstantValues.TWITTER_CONSUMER_KEY); configurationBuilder.setOAuthConsumerSecret(ConstantValues.TWITTER_CONSUMER_SECRET); configurationBuilder.setUseSSL(true); Configuration configuration =...

Facebook Android API asks for additional permission


android,facebook,facebook-graph-api
I am using v2.3 api here I can login with Facebook login button. Now how can I call additional permission on click? I have looked through answers for this question, but all of them look to be back-dated. Can someone show me the right way of asking for addition permission...

Android custom calendar view disable specific dates


android,calendarview
i'm new to android developing and started to develop an booking app. There is a calendar view and i want to disable booked dates in that calendar. I found out that disabling feature is not there in android default calendar. so could you please help me to find a good...

Android Implicit Intent for Viewing a Video File


java,android,android-intent,uri,avd
In my Android app, I have a button that when clicked, launches the external application of my choice to play a video (I gather that this is called an "implicit intent"). Here is the relevant Java code from my onCreate method. Button button = (Button) findViewById(R.id.button); button.setOnClickListener ( new Button.OnClickListener()...

Android programming, draw a rectangle with specific coordinates


android
I am new to android programming. I am trying to draw a rectangle as in the image below. I have no idea how to do it with Rect(int left, int top, int right, int bottom). Can someone help me with this thanks. ...

Why are shaders and programs stored as integers in OpenGL?


c++,opengl,opengl-es,integer,shader
I'm following the "OpenGL Superbible" book and I can't help but notice that when we create a shader and create the program that we attach the shaders to, we store them as GLuint which are unsigned integers. Why are they stored as numbers? What does the value of the number...

Notification whenever a new topic is created on mosquitto


android,mqtt,mosquitto,libmosquitto
I am trying to implement Push notifications on Android, using Mosquitto broker. So, different android application create topics based on tehir id on which they will receive notifications. To send notifications to those android applications we need the name of the topic. I am wondering if there is a way...

pointer to pointer dynamic array in C++


c++,arrays,pointers
I've been having bad luck with dynamic pointers when I want to close it. why the application wrote to memory after end of heap buffer? how can I close my array? int main() { . . int **W; W = new int* [n]; for (int i=1; i <= n; i++)...

Contexts and callbacks from asynchronous tasks


android,android-fragments,asynchronous
I've been experiencing this problem on some devices, especially Samsung. I have an activity that has 7 fragments. In most of them, I start an async task for getting some data. I handle the exceptions by creating a handler in onCreateView(). handler = new Handler(new Handler.Callback() { @Override public boolean...

Method returning std::vector>


c++
As a continuation of a: Thread, I came across a problem with writing a method of a class which returns: std::vector<std::unique_ptr<Object>> I get compiler errors when such a return type is written. There is some problem with delete operand or something ... Generally, I've wanted to write a method which...