Tag Archives: Android

[Solved] CommandWithNoStdoutInvokationFailure Unable to start ADB server.

Error: CommandWithNoStdoutInvokationFailure: Unable to start ADB server. Please make sure the Android SDK is installed and is properly configured in the Editor
Error:

CommandWithNoStdoutInvokationFailure: Unable to start ADB server. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
UnityEditor.Android.Command.RunWithShellExecute (System.String command, System.String args, System.String workingdir, System.String errorMsg) (at <61e151d28db74087bf4788498b7351e6>:0)
UnityEditor.Android.ADB.StartServer () (at <61e151d28db74087bf4788498b7351e6>:0)
UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <61e151d28db74087bf4788498b7351e6>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension.GetKnownTargets (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.ProgressHandler progressHandler) (at <61e151d28db74087bf4788498b7351e6>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.GetTargetDevices (UnityEditor.Android.ADB adb) (at <61e151d28db74087bf4788498b7351e6>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <61e151d28db74087bf4788498b7351e6>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <61e151d28db74087bf4788498b7351e6>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

 

Solution:

This problem is only applicable to windows, if it is linux or mac, please follow the relevant instructions to use the shell statement to configure in the termination.
If the sdk is installed on Windows, enter cmd in the run, call up the windows command line, enter adb, and the system feedback says that it is not a system command. . . . .
The solution is simple:
Go to the tools directory under the Android sdk directory, find two files, adb.exe and AdbWinApi.dll, select them, copy them, and paste them in the system directory /windows/system32/.
Then enter adb in the command line, the problem is solved!

[Solved] Activity jump permission UID Error: ActivityTaskmanager: Permission Denied

Scenario.
Settings application’s interface, pulling up Dialer’s interface reports an error.


Error Messages:

//Fail log:Settings->ApnEditorActivity
01-11 16:46:07.938 1044 6380 W ActivityTaskManager: Permission Denial: package=com.android.settings does not belong to uid=1001
//Pass log: Settings->ApnSettingsActivity
01-11 16:46:03.997 1044 1694 I ActivityTaskManager: START u0 {act=android.intent.action.CALL_BUTTON flg=0x10000000 cmp=com.android.dialer/.app.DialpadActivity} from uid 1000

UI corresponding process configuration

<!--AndroidManifest.xml-->
<activity android:name="Settings$ApnEditorActivity"
    android:process="com.android.phone">

Cause analysis:

UI on COM android. Settings, Android: process = “com. Android. Phone” is configured, and they are in different processes.

Source code reference: XRef:/packages/apps/settings/androidmanifest xml (revision 939136b)

<!--xref: /packages/apps/Settings/AndroidManifest.xml (revision 939136b3)-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
        package="com.android.settings"
        coreApp="true"
        android:sharedUserId="android.uid.system">

The settings application is in system and the phone belongs to radio

adb shell
top # Check the progress

// top
PID USER         PR  NI VIRT  RES  SHR S[%CPU] %MEM     TIME+ ARGS
6558 system    20 0 1.0G 137M 110M S 0.0 15.6 0:06.92 com.android.settings
6138 radio        20   0 1.1G 113M  98M S  0.3  12.9   1:19.43 com.android.phone


Solution:
According to the log ActivityTaskManager: Permission Denial: package=com.android.settings does not belong to uid=1001, it should be a package and process mismatch. Remove the configuration of android:process=”com.android.phone”.

How to Solve Android wechat payment Error: error_code = -1

Usually this error is a signature error

This figure is the case given by wechat. The signature is MD5. Note that there is no colon here. Check whether there is more colon

For example:

MD5: 01:B3:DF:B0:8F:AB:39:07:A2:F7:F3:CF:54:F0:1E:C9

Then I fill in:

01B3DFB08FAB3907A2F7F3CF54F01EC9

It’s easy to make mistakes here. I write it down here. I hope it can help you!

As for signature acquisition: Click gradle on the far right of Android studio, select singreport, double-click, and you can see it in build,

By the way, if you want to build Signature files are configured under gradle (APP)

AAPT2 error: check logs for details [How to Solve]

First, state that there are several reasons for this error

Here are my personal solutions to this error:

1. First, find gradle Properties file, open

2. Write “Android” in the space After enableaapt2 = false, click sync now

3. Errors will occur after synchronization. Don’t worry. Delete what you wrote and synchronize again

There is no problem running after resynchronization (personal situation)

[Solved] Android8.1 Compile Error: SSL error when connecting to the Jack server

An error occurs when compiling the source code of RK embedded development board
problem:

Solution:

CD/etc/java-8-openjdk/security/to this directory; sudo vim java. Security (note that it needs to be opened and modified by the root user); Delete the “tlsv1, tlsv1.1” configurations and save to exit:
restart the jack server:

cd /prebuilts/sdk/tools/ 
./jack-admin kill-server 
./jack-admin start-server 

After recompiling the source code, the problem will no longer be reported

Could not identify launch activity: Default Activity not foundError while Launching activity

Add in activity

<intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>

When the app has multiple activities, the activity to be started is the main interface and is set to MAIN.

LAUNCHER indicates whether it is displayed in the mobile app list.

[Solved] Could not identify launch activity: Default Activity not found Error while Launching activity

        <activity android:name=".ui.home.HomeActivity"
            android:configChanges="mcc|mnc"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.Preference.DayNight"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
<!--                <category android:name="android.intent.category.LAUNCHER" />-->
            </intent-filter>
        </activity>

The reason for this is that the < category > line was commented out in the entry activity. The default activity is not found,
Remove the comment and the problem is gone!

[Solved] AAPT: error: resource android:attr/lStar not found

Recently, I want to try the KTX expansion Library of Android core in the project:

implementation "androidx.core:core-ktx:1.7.0"

After adding dependency, we happily start to use various concise syntax sugars provided by KTX to fly happily~

Once running, wow, I reported an error:

Android resource linking failed /Users/xxx/.gradle/caches/transforms-2/files-
2.1/5d04bb4852dc27334fe36f129faf6500/res/values/values.xml:115:5-162:25:
 AAPT: error: resource android:attr/lStar not found.

 

Solution 1:

If the dependency method is
AndroidX.Core: core-ktx:+
you need to replace it with a specific version
AndroidX.core:core-ktx:1.6.0

Solution 2:

If the version is  1.7.0, the compilesdkversion of the project is 31, because my project is 30, an error will be reported and changed to 1.6.0 version is good

[Solved] Error: The superclass, ‘Animal‘, has no unnamed constructor that takes no arguments.

Error: The superclass, ‘Animal’, has no unnamed constructor that takes no arguments.

Problem Description:

Because the constructor cannot inherit
an error is reported during inheritance, which prompts that the constructor in the parent class is composed of parameters. You need to write the constructor in the subclass and pass the constructor of the parent class to parameters

class Animal {
  String name;
  int age;
  Animal(this.name, this.age);

  void printInfo() {
    print('$name is $age years old');
  }
}

//Inherit Animal class by extends keyword
class Cat extends Animal {
 
}

void main(List<String> args) {
  Cat cat = new Cat();
 print( cat.name);
}

Solution:

Super keyword

Try declaring a zero argument constructor in ‘Animal’, or declaring a constructor in Cat that explicitly invokes a constructor in ‘Animal’.dart(no_default_super_constructor)

Try declaring a zero parameter constructor in “animal” or a constructor that explicitly calls the constructor in “animal” in cat.dart (no default super constructor)

class Animal {
  String name;
  int age;
  Animal(this.name, this.age);

  void printInfo() {
    print('$name is $age years old');
  }
}

//Inherit Animal class by extends keyword
class Cat extends Animal {
  Cat(String name, int age) : super(name, age);

}

void main(List<String> args) {
  Cat cat = new Cat("Huahua",3);
 print( cat.name);
}

[Solved] Android Studio Error: CreateProcess error = 206 file name or extension is too long

When Android studio develops Android projects, the error “CreateProcess error = 206” is easy to appear every time it runs. The console error message says that the file name or extension is too long. I used openjdk to solve this problem. I found many ways to solve it. For a long time, I can only restart Android studio or forcibly end the JDK process in the application manager. Later, I just changed the open JDK to Oracle JDK.