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
    public void onCreate(Bundle savedInstanceState)
        // Set by <content src="index.html" /> in config.xml

No comments:

Post a Comment


You will like to read it