我正在尝试在android studio中运行一个android项目。在gradle sync期间,我收到以下错误:
即使我尝试从终端执行文件,我也会收到同样的错误:
Mycomputer:~/Android/Sdk/build-tools/28.0.0-rc1$ ./arm-linux-androideabi-ld
bash: ./arm-linux-androideabi-ld: No such file or directory
我尝试了以下内容:
我仍然没有任何成功。
答案 0 :(得分:0)
似乎您缺少32位库。执行它们时会导致异常viewDidLoad()
。
func fetchPost() {
Api.Posts.observePostIncludingImages(withId: postId) { (post, photosStringArray) in
self.isLiked(postId: post.id!, completion: { boolValue in
Api.Posts.fetchCount(postId: post.id!, completion: { totalCount in
post.isLiked = boolValue
self.photosArrayString = photosStringArray
print(photosStringArray) // prints the actual image string
self.setScrollView()
})
})
}
}
func setScrollView() {
for i in stride(from: 0, to: photosArrayString.count, by: 1) {
var frame = CGRect.zero
frame.origin.x = self.galleryScrollView.frame.size.width * CGFloat(i)
frame.origin.y = 0
frame.size = self.galleryScrollView.frame.size
galleryScrollView.isPagingEnabled = true
let newUIImageView = UIImageView()
print(photosArrayString[i]) // Prints the value again
let myImage = UIImage(named: photosArrayString[i])! // CRASHES! i = 0 (first item in the array)
avgBackgroundColorsOfImage.append(myImage.averageColor!)
newUIImageView.image = myImage
newUIImageView.frame = frame
newUIImageView.contentMode = UIViewContentMode.scaleAspectFit
newUIImageView.sd_setImage(with: URL(string: self.photosArrayString[i]), completed: nil)
galleryScrollView.backgroundColor = avgBackgroundColorsOfImage[i]
galleryScrollView.addSubview(newUIImageView)
self.galleryScrollView.contentSize = CGSize(width: self.galleryScrollView.frame.size.width * CGFloat(photosArrayString.count),
height: self.galleryScrollView.frame.size.height)
pageControl.addTarget(self, action: #selector(changePage), for: UIControlEvents.valueChanged)
}
}
此外,您可以检查文件是否为32位,以确保这是原因:
No such file or directory
输出:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1