Chromium WebView does not exist - java

I am trying to create a Hello World app using Phonegap but it crashes when I call run the application on emulator. I followed the guideline here. Here is what I have on MainActivity.java :
package com.example.hello;
import android.os.Bundle;
import org.apache.cordova.*;
public class HelloWorld extends CordovaActivity
{
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
// Set by <content src="index.html" /> in config.xml
super.loadUrl(Config.getStartUrl());
//super.loadUrl("file:///android_asset/www/index.html");
}
}
Here is my AndroidManifest.xml :
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" android:windowSoftInputMode="adjustPan" package="com.example.hello" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="#string/app_name" android:launchMode="singleTop" android:name="HelloWorld" android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="20" />
</manifest>
Here is the first errors I get :
Chromium WebView does not exist
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.deneme/com.example.deneme.MainActivity}:
java.lang.UnsupportedOperationException
Can you tell me what is wrong with the application? Thanks.

Actually, not every Android phone ships with Chromium as WebView engine (https://developer.chrome.com/multidevice/webview/overview). For instance, my Samsung Galaxy Ace2 with Android 4.1.2 has old WebView engine. User agent string denotes some unknown Mozilla version, HTML5 apps look&feel and behavior differs from Chrome. However, PhoneGap apps do not raise errors on my phone.
I don't know why you're getting "Chromium WebView does not exist" error, but since you're on the very beginnig on your way (cause you're trying to build Hello World app using Phonegap) I want to point to another option. Using Crosswalk project allows you not to deal with various WebView engines on every android device but use embedded in your app chromium engine - always the same on every android device. The crosswalk project is available for android and tizen platforms. So to build crossplatform app (android an iOS) I would suggest to use either
Intel XDK, which can use single html5 source code with XDK api and Cordova api, that can be compiled to android app using crosswalk or compiled to iOS using native WebView.
Crosswalk+Cordova to build android app and PhoneGap to build iOS app from the same sources
This approach can eliminate pain on supporting various android devices.
See also:
http://html5hub.com/building-cordova-applications-with-crosswalk/
https://groups.google.com/forum/#!topic/phonegap/IxSuRUScbMs

Related

Application not compatible with older Android versions

I'm generating an Android application via mvn -Pandroid gluonfx:build gluonfx:package. Here are the versions from the POM:
<maven-compiler-plugin-version>3.10.1</maven-compiler-plugin-version>
<maven-surefire-plugin-version>3.0.0-M6</maven-surefire-plugin-version>
<javafx-maven-plugin-version>0.0.8</javafx-maven-plugin-version>
<gluonfx-maven-plugin-version>1.0.14</gluonfx-maven-plugin-version>
<java-version>17</java-version>
<javafx-version>18.0.1</javafx-version>
<charm-version>6.1.0</charm-version>
<attach-version>4.0.15</attach-version>
Using graalvm-svm-java17-linux-gluon-22.1.0.1-Final
The application works well on Android 8. However, when trying to install it on Android 7.0, a message pops up saying that the application is not compatible with the device. I'm not sure where the default version is specified, but following the instructions, I copied the manifest file, which was
<?xml version='1.0'?>
<manifest xmlns:android='http://schemas.android.com/apk/res/android' package='my.app.demo' android:versionCode='1' android:versionName='1.0'>
<supports-screens android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label='MyApp' android:icon="#mipmap/ic_launcher">
<activity android:name='com.gluonhq.helloandroid.MainActivity' android:configChanges="orientation|keyboardHidden">
<intent-filter>
<category android:name='android.intent.category.LAUNCHER'/>
<action android:name='android.intent.action.MAIN'/>
</intent-filter>
</activity>
<activity android:name='com.gluonhq.helloandroid.PermissionRequestActivity'/>
</application>
</manifest>
and added a line for supporting sdk 24 (matches Android 7.0):
...
<supports-screens android:xlargeScreens="true"/>
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="24"/>
<uses-permission android:name="android.permission.INTERNET"/>
...
Then I put it in my project under src/android/AndroidManifest.xml and ran mvn -Pandroid gluonfx:build gluonfx:package again. The APK was generated successfully, but upon installation the same error message appeared.
How do I install the app on Android 7.0?
As mentioned in the comments, the device uses an ARMv7 processor, which uses a 32bit architecture. GraalVM supports only 64 bits, so the APKs produced by it will work only on devices with 64bits, like those with ARMv8.

Adb Transfer Protocol Error. No such file or directory

I tried to run my android app in a emulator using intelliJ 13, and I configured the emulator to be a Nexus 4 running android 4.4.2 with ARM cpu, and I got the follow errors:
Waiting for device.
"C:\Program Files (x86)\Android\android-sdk\tools\emulator.exe" -avd MyAVD0 -netspeed full -netdelay none
Device connected: emulator-5554
Device is online: emulator-5554
Target device: MyAVD0 [emulator-5554]
Uploading file
local path: C:\Users\daiyue\IdeaProjects\HelloDroid\out\production\HelloDroid\HelloDroid.apk
remote path: /data/local/tmp/com.example.HelloDroid
Adb Transfer Protocol Error.
No such file or directory
The following is my manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.HelloDroid"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19"/>
<application android:label="#string/app_name" android:icon="#drawable/ic_launcher">
<activity android:name=".MyActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
The emulator showed nothing on screen as well, only when I pressed hardware button to switch on the emulator and only 'android' logo showed up and stayed forever.
I built the app using Android SDK 4.4.2 api.
So the work around is to delete the MyAVD0 in C:\Users\username\.android\avd, and recreate MyAVD0 again using Android AVD Manager.

Android SDK VS Facebook R class conflict?

Okay first of all what I am doing is trying to integrate my Android game which is fully functional and tested to be working code onto Facebook.
I have been following the Facebook tutorial on how to set it up for Facebook and have been using the Android SDK version of the support v4 file.
The problem I have been having seems to be a conflict between the two SDK's.
R cannot be resolved to a variable.
For example
MediaPlayer song = MediaPlayer.create(this.getContext(), R.raw.ironman);
R.raw.ironman is where the problem occurs, which is a reference to the raw folder in my resources directory, where the mp3 file ironman is found.
It uses the R class which is part of the Android SDK
I had my game setup this way and it works great until I try to add the features from the tutorial.
For example
if (user != null)
{
TextView welcome = (TextView) findViewById(R.id.welcome);
welcome.setText("Hello " + user.getName() + "!");
}
R.id.welcome
This uses the R class which is part of the Facebook SDK for accessing a control the way it looks.
Another thing I noticed was that it keeps deleting my Java files as well.
from what I have read on other posts on here this is due to problems with the XML file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.SmashEm"
android:versionCode="2"
android:versionName="2.1" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#drawable/thumb"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:configChanges="orientation|keyboardHidden"
android:name="com.example.SmashEm.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:value="#string/app_id" android:name=" com.facebook.sdk.ApplicationId"/>
<activity android:name="com.facebook.LoginActivity" android:label="#string/app_name"></activity>
</application>
</manifest>
Maybe I am going about this all wrong but I just thought I would give this a try.
Any help would be a appreciated and thanks.
Also I am pretty sure this is different then all the other threads I read so far but I could be wrong since I am not an expert in Java.

parentActivityName not found in package android, despite using API 16 and support libs [duplicate]

I'm trying to complete this tutorial from the Android Page http://developer.android.com/training/basics/firstapp/starting-activity.html But I Eclipse throws this error: "No resource identifier found for attribute 'parentActivityName' in package 'android'" I have included the android-support-library.
Here is the whole AndroidManifest.xml code
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="#string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.myfirstapp.MainActivity" />
</activity>
</application>
android:parentActivityName appears first in Android 4.1 (API level 16). You need to have the latest 4.1 SDK to compile this.
To add to David Wasser's answer, if you use Eclipse and have the correct SDK library installed but still have this error, it means that while the correct library is installed Eclipse does not use it for this project.
To change that, go to your project's Properties (right-click on its name in the Package Explorer and it's the last but one option), select Android in the left hand column and you should have a list called Project Build Target. Then:
Select the appropriate target (Android 4.2.2 or Google APIs for Platform 4.2.2 in this instance)
Save your Manifest file (make a trivial edit if necessary)
Once it is saved Eclipse will process it and those errors should disappear as Eclipse finds the resource identifier in its new build target.
This error will also happen if you don't have the exact version of the SDK that the sample app uses as it's build target. Following the same steps as Julien describes above and choosing an SDK you have locally will fix it.
In IntelliJ IDEA, you need to change in Platform Settings->SDKs->Android something->Build target TO 4.1+.
If you don't see the option, you need an SDK version 4.1 or higher (API level 16+).

Android - "The server could not process your apk. Try again.." error when uploading on market

So this is my Android Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.xxxxxxxxxxxxxxxx"
android:versionCode="3"
android:versionName="1.02">
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Black.NoTitleBar" >
<activity
android:name=".XXXXXXXXXActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".XXXXXXXXXXXXXXXX"></activity>
</application>
</manifest>
Each time I upload to the android market, I get the error:
The server could not process your apk. Try again..
I previously uploaded a few APKs, but now I decided to downgrade my app, because it works on 2.1, previously it was on minimum 2.3. And since i've changed the minSdkVersion it doesn't want to upload anymore.
Looks like Android market is down. If you look carefully, you will see that upload does not even happen. So that error message is misleading you. Lets wait till Google resolves this.
#o2genum
I reported the problem here:
https://support.google.com/androidmarket/developer/bin/request.py?contact_type=bugs
(under "problems with the developer console")
And sent them the URL to this report
Edit:
Just saw this in the console:
22 February 2012: Application uploading and editing issues.
We are aware of issues with uploading and editing applications in the Android Market Developer Console. We apologize for this inconvenience and are working to fix this as soon as we can.

Categories

Resources