我正在尝试使用 xwalkview 构建混合应用程序,但不断收到此错误。我添加了 crosswalk-webview-arm 库和 appcompat-v7 库和 2 个罐子。android-support-v4 jar 和 xwalk-core-library.jar。删除其中任何一个都会产生编译时间错误。
android_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.hcp_android.NewMainActivity" >
<org.xwalk.core.XWalkView
android:id="@+id/webPage"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
新MainActivity.java
public class NewMainActivity extends Activity {
XWalkView xwalkview;
MediaPlayer ringtone;
AndroidJSInterface jSInterface;
boolean doubleBackToExitPressedOnce = false;
int k = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
xwalkview=(XWalkView)findViewById(R.id.webPage);
jSInterface = new AndroidJSInterface(this);
xwalkview.addJavascriptInterface(jSInterface, "AndroidJSInterface");
xwalkview.load("file:///android_asset/login.html", null);
}