Home > Mobile >  MAC version Androidstudio fremawork cannot use manufacturer. The jar
MAC version Androidstudio fremawork cannot use manufacturer. The jar

Time:11-04

MAC Androidstudio, in view of the factory custom equipment development, use the framework provided by the equipment manufacturer. The jar package, unable to complete the compilation and packaging
Can introduce fremawork jars, and then develop when the hidden interface, also won't complain, but you can't really pack machine debugging and installation package
I've tried androidstudio all stable version, the club's official website from 2.3.2 to 4.1, all can't complete the compilation and packaging

Androidstudio under Windows, is possible,

Steps are as follows:
1, modify build under the progect. Gradle,
Allprojects {
Repositories {
Google ()
Jcenter ()
}
}
Instead of
Allprojects {
Repositories {
Google ()
Jcenter ()
Gradle. ProjectsEvaluated {
The tasks. WithType (JavaCompile) {
Options.com pilerArgs. Add (' - Xbootclasspath/p: app \ \ libs \ \ framework jar ')
}
}
}
}

2, build under modify app. Gradle, will
Dependencies {
Implementation fileTree (include: [' *. Jar '], dir: 'libs')
}
Instead of
Dependencies {
CompileOnly files (' libs/framework. The jar)
}
And add the following code
PreBuild {
DoLast {
Def imlFile=file (the project name + ". "on iml)
Println (" Change "+ project. The name + 'on iml order')
Try {
Def parsedXml=(new XmlParser ()). The parse (imlFile)
Def jdkNode=parsedXml.com ponent. [1] orderEntry. Find {it. '@ type'=='JDK'}
ParsedXml.com ponent [1]. Remove (jdkNode)
Def sdkString="Android API" + android.com pileSdkVersion. Substring (" Android - ". The length ()) + "Platform"
New groovy. Util. Node (parsedXml.com ponent [1], 'orderEntry' [' type ':' the JDK ', 'jdkName: sdkString,' jdkType ':' the Android SDK])
Groovy. XML. XmlUtil. Serialize (parsedXml, new FileOutputStream (imlFile))
} the catch (FileNotFoundException e) {
//the nop, on iml not found
}
}
}

Through the above steps, the Windows the Androidstudio can normal use the manufacturer's framework. The jar,
But to the MAC Androidstudio just don't, can call framework hidden method, unable to complete the compilation and packaging,
For help each ace, provide some solution, thanks

CodePudding user response:

90% reason, introducing path problem,
  • Related