I am just configuring my phonegap application and set to run "HelloWorld" Problem. But i cant execute it properly since it always throws me the following error.
Cannot reduce the visibility of the inherited method from DroidGap
The import com.phonegap cannot be resolve
And here is my Code in MainActivity.java
package com.example.mobile;
import org.apache.cordova.DroidGap;
import android.os.Bundle;
import android.view.Menu;
import com.phonegap.*;
public class MainActivity extends DroidGap {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
I have created the libs folder and added the cordova-2.2.0.jar , and added to the bulid path. But Still i cant figure out the problem , kindly suggest me a solution to fix it up.
Thanks
Seems like you have 2 problems:
Cannot reduce the visibility of the inherited method from DroidGap
- try changing protected void onCreate
to public void onCreate
.The import com.phonegap cannot be resolve
- try removing the line import com.phonegap.*;
I had the same issue:
change:
protected void onCreate(Bundle savedInstanceState)
to:
public void onCreate(Bundle savedInstanceState)
This worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With