Others

Saturday, 20 January 2018

cordova "no java files found that extend cordovaactivity"

Getting Error as:

Severity Code Description Project File Line Suppression State Error No Java files found which extend CordovaActivity. OilFreeRecipes 1

This issue is causing due to missing of MainActivity.Java File Generally it is residing on the below path.
[Application Name]\platforms\android\src\com
Here it should have the folder name based on the namespace you have given. Suppose I have given namespace as com.passion.oilfreerecipes So there should have folder passion --> OilfreeRecipes


And inside of their you should have MainActivity.Java.
It clears in my application as i clean the solution. You can copy and paste from other project and change the mainActivity.Java based on your need.

Now open the mainActivity.Java and change the package name written their.

Or you can use Below Java code save it as MainActivity.Java.

package com.passion.oilfreerecipes;  /* Change this  package name */

import android.os.Bundle;
import org.apache.cordova.*;

public class MainActivity extends CordovaActivity
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        // Set by <content src="index.html" /> in config.xml
        loadUrl(launchUrl);
    }
}




2 comments:

  1. Great blog.you put Good stuff.All the topics were explained briefly.so quickly understand for me.I am waiting for your next fantastic blog.Thanks for sharing.Any coures related details learn...

    Angularjs course in chennai

    ReplyDelete
  2. Pardon me if I wrong, I'm not into programming for a long time, so my point of view could be quite populistic, but whatever. In order to make this clear, I am new to programming, like new-new, just some months of learning Java. I had been trying to sort things out with C++ before that, so it appeared to me as too much complexity takes place here, alongside with it's quite difficult to get clear not only for beginners, as I may judge by feedback of some friends of mine, who are way more experienced in these things. Especially comparing with Java, that is, at the first point, not so complex, and second, has some learning resources written in quite easy language, so there are no such things as difficulties with how to learn java https://explainjava.com even if you has no programming experience at all under your belt, as myself. Thus I hope C++ will be replaced someday with some low-level language for sure, given the fact how development community is growing nowadays

    ReplyDelete