Adb Transfer Protocol Error. No such file or directory - java

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.

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.

Chromium WebView does not exist

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

How to solve AVD auto rotate screen issue in android 4.4.2?

When I use an AVD to run a simple app, I need to have a look at landscape view, after some search , I checked my "Auto rotate screen" setting in Settings->Display->Auto rotate screen, then I can rotate the window by click CTRL+F11, but the content in my app don't show as I expected.
I found there was a bug report about Android 2.3 AVD (Issue 13189: Orientation does not change from landscape to portrait on Emulator on 2.3), but no body has resolved it by now.
Anyone can have some idea?
This is the problem:
portrait view:
landscape view:
This is my AVD Details:
This is AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.SimpleFragment"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="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>
Try to using Genymotion Emulator instead or AVD. It has a rotate button between landscape and portrait

Java Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY maps

I downloaded an android map app and am trying to successfully run the app. When I build and run, I however run into an error here.
--my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.shawnbe.mallfinder"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<activity
android:label="#string/app_name"
android:name=".MallFinderActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:required="true" android:name="com.google.android.maps" />
</application>
<uses-feature android:name="android.hardware.location.gps"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
//logcat error
08-04 16:55:34.492: E/PackageManager(59): Package com.shawnbe.mallfinder requires unavailable shared library com.google.android.maps; failing!
08-04 16:55:34.492: W/PackageManager(59): Package couldn't be installed in /data/app/com.shawnbe.mallfinder.apk
[2012-08-04 12:00:34 - com.shawnbe.mallfinder.MallFinderActivity] ------------------------------
[2012-08-04 12:00:34 - com.shawnbe.mallfinder.MallFinderActivity] Android Launch!
[2012-08-04 12:00:34 - com.shawnbe.mallfinder.MallFinderActivity] adb is running normally.
[2012-08-04 12:00:34 - com.shawnbe.mallfinder.MallFinderActivity] Performing com.shawnbe.mallfinder.MallFinderActivity activity launch
[2012-08-04 12:00:34 - com.shawnbe.mallfinder.MallFinderActivity] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'MAPAPP1'
[2012-08-04 12:00:34 - com.shawnbe.mallfinder.MallFinderActivity] Uploading com.shawnbe.mallfinder.MallFinderActivity.apk onto device 'emulator-5554'
[2012-08-04 12:00:35 - com.shawnbe.mallfinder.MallFinderActivity] Installing com.shawnbe.mallfinder.MallFinderActivity.apk...
[2012-08-04 12:00:37 - com.shawnbe.mallfinder.MallFinderActivity] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2012-08-04 12:00:37 - com.shawnbe.mallfinder.MallFinderActivity] Please check logcat output for more details.
[2012-08-04 12:00:37 - com.shawnbe.mallfinder.MallFinderActivity] Launch canceled!
Your emulator AVD does not have Google Maps. Create an emulator AVD with a "Target" that has "Google APIs (Google Inc.)" in the name.

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